mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
Split out status update into its own function.
This commit is contained in:
parent
6ca0982865
commit
7fff75c2c0
@ -5,13 +5,17 @@ var Transport = can.Control.extend({
|
||||
element.html(can.view('views/transport.ejs'));
|
||||
},
|
||||
|
||||
updateStatus: function(status) {
|
||||
this.status.attr(status);
|
||||
},
|
||||
|
||||
sendCommand: function(command) {
|
||||
var self = this;
|
||||
can.ajax({
|
||||
url: '/api/control/' + command,
|
||||
type: 'PUT',
|
||||
success: function(status) {
|
||||
self.status.attr(status);
|
||||
self.updateStatus(status);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user