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-artists.js
2014-01-10 17:01:34 +00:00

32 lines
582 B
JavaScript

can.Component.extend({
tag: 'mpd-panel-artists',
template: can.view('views/panels/artists.mustache'),
init: function() {
var self = this;
Artist.findAll({}, function(data) {
console.log(data);
self.scope.attr('items', data);
self._control.element.trigger('showPanel', self.scope.depth);
});
},
scope: {
depth: "@"
},
helpers: {
link: function(item) {
return can.route.link(item.name, {
type: 'library',
show: 'albums',
artist: item.name,
depth: +this.depth + 1
});
},
}
});