1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00
mpd-client/assets/js/components/transport.js
2014-01-08 11:19:17 +00:00

23 lines
412 B
JavaScript

can.Component.extend({
tag: 'mpd-transport',
template: can.view('views/transport.mustache'),
events: {
sendCommand: function(command) {
can.ajax({
url: '/api/control/' + command,
type: 'PUT'
});
},
'button click': function(element, event) {
var command = $(element).data('command');
this.sendCommand(command);
$(element).blur();
}
}
});