1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00
mpd-client/assets/js/components/panel.js
Dan Barber cc3a6217da Partway through component refactor.
* Queue now displays.
* Does not yet update.
2013-12-20 15:29:39 +00:00

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, {});
}
}
});