1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00
mpd-client/assets/js/controls/queue.js
2013-12-09 16:57:42 +00:00

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);
}
});