mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
27 lines
513 B
JavaScript
27 lines
513 B
JavaScript
var Queue = can.Control.extend({
|
|
|
|
init: function(element, options) {
|
|
element.html(
|
|
can.view('views/queue.ejs', {
|
|
queueSongs: options.queueSongs,
|
|
status: options.status
|
|
},
|
|
{ formatLength: timeHelpers.formatLength }
|
|
));
|
|
},
|
|
|
|
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);
|
|
}
|
|
|
|
});
|