mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
24 lines
445 B
JavaScript
24 lines
445 B
JavaScript
var Queue = can.Control.extend({
|
|
|
|
init: function(element, options) {
|
|
element.html(can.view('views/queue.ejs', {
|
|
queueSongs: options.queueSongs,
|
|
status: options.status
|
|
}));
|
|
},
|
|
|
|
playSong: function(pos) {
|
|
can.ajax({
|
|
url: '/api/control/play',
|
|
data: { pos: pos },
|
|
type: 'PUT'
|
|
});
|
|
},
|
|
|
|
'li click': function(element, event) {
|
|
var pos = $(element).data('pos');
|
|
this.playSong(pos);
|
|
}
|
|
|
|
});
|