mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 09:03:49 -07:00
Save and add, notif settings cleanup
This commit is contained in:
parent
7f59062215
commit
f7c340d795
15 changed files with 151 additions and 43 deletions
|
@ -15,9 +15,11 @@ define([
|
|||
template: 'Settings/Notifications/EditTemplate',
|
||||
|
||||
events: {
|
||||
'click .x-save' : '_saveNotification',
|
||||
'click .x-remove': '_deleteNotification',
|
||||
'click .x-test' : '_test'
|
||||
'click .x-save' : '_saveNotification',
|
||||
'click .x-save-and-add' : '_saveAndAddNotification',
|
||||
'click .x-delete' : '_deleteNotification',
|
||||
'click .x-back' : '_back',
|
||||
'click .x-test' : '_test'
|
||||
},
|
||||
|
||||
ui: {
|
||||
|
@ -41,14 +43,26 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
_saveAndAddNotification: function () {
|
||||
var self = this;
|
||||
var promise = this.model.saveSettings();
|
||||
|
||||
if (promise) {
|
||||
promise.done(function () {
|
||||
self.notificationCollection.add(self.model, { merge: true });
|
||||
|
||||
require('Settings/Notifications/SchemaModal').open(self.notificationCollection);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_deleteNotification: function () {
|
||||
var view = new DeleteView({ model: this.model });
|
||||
App.modalRegion.show(view);
|
||||
},
|
||||
|
||||
_saveSuccess: function () {
|
||||
this.notificationCollection.add(this.model, { merge: true });
|
||||
App.modalRegion.closeModal();
|
||||
_back: function () {
|
||||
require('Settings/Notifications/SchemaModal').open(this.notificationCollection);
|
||||
},
|
||||
|
||||
_test: function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue