mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
32 lines
591 B
JavaScript
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
});
|