mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 16:13:58 -07:00
38 lines
977 B
JavaScript
38 lines
977 B
JavaScript
'use strict';
|
|
|
|
define(
|
|
[
|
|
'marionette',
|
|
'Commands/CommandController'
|
|
], function (Marionette, CommandController) {
|
|
return Marionette.ItemView.extend({
|
|
template: 'System/Update/UpdateItemViewTemplate',
|
|
|
|
events: {
|
|
'click .x-install-update': '_installUpdate'
|
|
},
|
|
|
|
initialize: function () {
|
|
this.updating = false;
|
|
},
|
|
|
|
_installUpdate: function () {
|
|
if (this.updating) {
|
|
return;
|
|
}
|
|
|
|
this.updating = true;
|
|
var self = this;
|
|
|
|
var promise = CommandController.Execute('installUpdate', { updatePackage: this.model.toJSON() });
|
|
|
|
promise.done(function () {
|
|
window.setTimeout(function () {
|
|
self.updating = false;
|
|
}, 5000);
|
|
});
|
|
|
|
|
|
}
|
|
});
|
|
});
|