You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/UI/Mixins/SaveIfChangedModel.js

29 lines
673 B

"use strict";
(function () {
NzbDrone.Mixins.SaveIfChangedModel = {
// originalInitialize: this.initialize,
initialize: function () {
this.isSaved = true;
this.on('change', function () {
this.isSaved = false;
}, this);
this.on('sync', function () {
this.isSaved = true;
}, this);
// if (originalInitialize) {
// originalInitialize.call(this);
// }
},
saveIfChanged: function (options) {
if (!this.isSaved) {
this.save(undefined, options);
}
}
};
}());