mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
33 lines
658 B
JavaScript
33 lines
658 B
JavaScript
can.Component.extend({
|
|
|
|
tag: 'mpd-panel',
|
|
|
|
template: can.view('views/panel.mustache'),
|
|
|
|
scope: {
|
|
show: '@',
|
|
depth: '@',
|
|
artist: '@',
|
|
album: '@',
|
|
title: function() {
|
|
if (this.show == 'root')
|
|
return 'Library';
|
|
},
|
|
fetchItems: {
|
|
root: new can.Map,
|
|
artists: function() { return Artist.findAll({}) },
|
|
albums: function() { Album.findAll({ artist: this.artist }) },
|
|
songs: function() { Song.findAll({ artist: this.artist, album: this.album }) }
|
|
}
|
|
},
|
|
|
|
events: {},
|
|
|
|
helpers: {
|
|
renderItems: function() {
|
|
return can.view.render('views/library/' + this.show, {});
|
|
}
|
|
}
|
|
|
|
});
|