1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00
mpd-client/assets/js/components/library.js
2014-01-08 15:02:44 +00:00

32 lines
591 B
JavaScript

can.Component.extend({
tag: 'mpd-library',
template: can.view('views/library.mustache'),
events: {
show: function() {
$(this.element).addClass('show');
},
hide: function() {
$(this.element).removeClass('show');
},
'a.close click': 'hide',
':type route': function(data) {
if (data.type == 'library') {
this.show();
if (data.pane > this.browser.currentPane) {
this.addPane(data);
}
else if (data.pane < this.browser.currentPane) {
this.removePane(data);
}
}
}
}
});