1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 11:25:26 +00:00
Radarr/UI/Settings/General/GeneralView.js
2013-05-28 19:49:33 -07:00

30 lines
1 KiB
JavaScript

'use strict';
define(['app', 'Settings/SettingsModel', 'Shared/Messenger'], function () {
NzbDrone.Settings.General.GeneralView = Backbone.Marionette.ItemView.extend({
template: 'Settings/General/GeneralTemplate',
initialize: function () {
NzbDrone.vent.on(NzbDrone.Commands.SaveSettings, this.saveSettings, this);
},
saveSettings: function () {
if (!this.model.isSaved) {
this.model.save(undefined, this.syncNotification("General Settings Saved", "Couldn't Save General Settings"));
}
},
syncNotification: function (success, error) {
return {
success: function () {
NzbDrone.Shared.Messenger.show({message: success});
},
error : function () {
NzbDrone.Shared.Messenger.show({message: error, type: 'error'});
}
};
}
}
);
});