mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-31 12:10:19 -07:00
Settings save when changed only
This commit is contained in:
parent
8b8ee912c0
commit
bddbc7a0cf
7 changed files with 39 additions and 34 deletions
|
@ -1,13 +1,11 @@
|
|||
'use strict';
|
||||
define(['app', 'Settings/Naming/NamingModel'], function () {
|
||||
define(['app',
|
||||
'Settings/Naming/NamingModel',
|
||||
'Settings/SyncNotification'], function () {
|
||||
|
||||
NzbDrone.Settings.Naming.NamingView = Backbone.Marionette.ItemView.extend({
|
||||
template : 'Settings/Naming/NamingTemplate',
|
||||
|
||||
ui: {
|
||||
tooltip: '[class^="help-inline"] i'
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
this.model = new NzbDrone.Settings.Naming.NamingModel();
|
||||
this.model.fetch();
|
||||
|
@ -15,13 +13,8 @@ define(['app', 'Settings/Naming/NamingModel'], function () {
|
|||
NzbDrone.vent.on(NzbDrone.Commands.SaveSettings, this.saveSettings, this);
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
//TODO: Move this to a mixin
|
||||
this.ui.tooltip.tooltip({ placement: 'right' });
|
||||
},
|
||||
|
||||
saveSettings: function () {
|
||||
this.model.save(undefined, NzbDrone.Settings.SyncNotificaiton.callback({
|
||||
this.model.saveIfChanged(undefined, NzbDrone.Settings.SyncNotificaiton.callback({
|
||||
successMessage: 'Naming Settings saved',
|
||||
errorMessage: "Failed to save Naming Settings"
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue