mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
SaveIfChangedMixin
This commit is contained in:
parent
9a68785c26
commit
c94595b3ae
4 changed files with 43 additions and 7 deletions
30
UI/Mixins/SaveIfChangedModel.js
Normal file
30
UI/Mixins/SaveIfChangedModel.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
//try to add ajax data as query string to DELETE calls.
|
||||
"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);
|
||||
}
|
||||
}
|
||||
};
|
||||
}());
|
Loading…
Add table
Add a link
Reference in a new issue