mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
fixed saving settings. now done more generically.
This commit is contained in:
parent
d126c6efc1
commit
806e58ed1f
13 changed files with 104 additions and 161 deletions
|
@ -3,10 +3,8 @@
|
|||
define([
|
||||
'app',
|
||||
'marionette',
|
||||
'Shared/Messenger',
|
||||
'Mixins/AsModelBoundView'
|
||||
|
||||
], function (App, Marionette, Messenger, AsModelBoundView) {
|
||||
], function (App, Marionette, AsModelBoundView) {
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/Indexers/EditTemplate',
|
||||
|
@ -20,27 +18,9 @@ define([
|
|||
},
|
||||
|
||||
save: function () {
|
||||
this.model.save(undefined, this.syncNotification("Indexer Saved", "Couldn't Save Indexer", this));
|
||||
},
|
||||
|
||||
syncNotification: function (success, error, context) {
|
||||
return {
|
||||
success: function () {
|
||||
Messenger.show({
|
||||
message: success
|
||||
});
|
||||
|
||||
context.indexerCollection.add(context.model);
|
||||
App.modalRegion.closeModal();
|
||||
},
|
||||
|
||||
error: function () {
|
||||
window.alert(error);
|
||||
}
|
||||
};
|
||||
this.model.saveSettings();
|
||||
}
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue