mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-26 17:57:43 +00:00
29 lines
No EOL
673 B
JavaScript
29 lines
No EOL
673 B
JavaScript
"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);
|
|
}
|
|
}
|
|
};
|
|
}()); |