Better message handling on save

This commit is contained in:
Mark McDowall 2013-05-31 17:22:47 -07:00
parent 03c085030e
commit ef58acb4b5
7 changed files with 63 additions and 64 deletions

View file

@ -10,19 +10,11 @@ define(['app', 'Settings/SettingsModel', 'Shared/Messenger'], function () {
saveSettings: function () {
if (!this.model.isSaved) {
this.model.save(undefined, this.syncNotification("General Settings Saved", "Couldn't Save General Settings"));
this.model.save(undefined, NzbDrone.Settings.SyncNotificaiton.callback({
successMessage: 'General Settings saved',
errorMessage: "Failed to 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'});
}
};
}
}
);