mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
33 lines
580 B
JavaScript
33 lines
580 B
JavaScript
can.Component.extend({
|
|
|
|
tag: 'mpd-panel-artists',
|
|
|
|
template: can.view('views/panels/artists.mustache'),
|
|
|
|
scope: {
|
|
depth: "@"
|
|
},
|
|
|
|
events: {
|
|
init: function() {
|
|
var self = this;
|
|
Artist.findAll({}, function(data) {
|
|
self.scope.attr('items', data);
|
|
self.element.trigger('switchPanel', self.scope.depth);
|
|
});
|
|
}
|
|
},
|
|
|
|
helpers: {
|
|
link: function(item) {
|
|
return can.route.link(item.name, {
|
|
type: 'library',
|
|
show: 'albums',
|
|
artist: item.name,
|
|
depth: +this.depth + 1
|
|
});
|
|
},
|
|
}
|
|
|
|
});
|