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