mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 16:43:58 -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
|
@ -5,11 +5,10 @@ define([
|
|||
'marionette',
|
||||
'Settings/Notifications/Model',
|
||||
'Settings/Notifications/DeleteView',
|
||||
'Settings/SyncNotification',
|
||||
'Shared/Messenger',
|
||||
'Mixins/AsModelBoundView'
|
||||
|
||||
], function (App, Marionette, NotificationModel, DeleteView, SyncNotification, Messenger, AsModelBoundView) {
|
||||
], function (App, Marionette, NotificationModel, DeleteView, Messenger, AsModelBoundView) {
|
||||
|
||||
var model = Marionette.ItemView.extend({
|
||||
template: 'Settings/Notifications/EditTemplate',
|
||||
|
@ -30,16 +29,11 @@ define([
|
|||
},
|
||||
|
||||
_saveNotification: function () {
|
||||
var name = this.model.get('name');
|
||||
var success = 'Notification Saved: ' + name;
|
||||
var fail = 'Failed to save notification: ' + name;
|
||||
var promise = this.model.saveSettings();
|
||||
|
||||
this.model.save(undefined, SyncNotification.callback({
|
||||
successMessage : success,
|
||||
errorMessage : fail,
|
||||
successCallback: this._saveSuccess,
|
||||
context : this
|
||||
}));
|
||||
if (promise) {
|
||||
promise.done(this._saveSuccess);
|
||||
}
|
||||
},
|
||||
|
||||
_deleteNotification: function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue