fixed saving settings. now done more generically.

This commit is contained in:
kay.one 2013-06-18 21:27:41 -07:00
parent d126c6efc1
commit 806e58ed1f
13 changed files with 104 additions and 161 deletions

View file

@ -3,10 +3,8 @@
define([
'app',
'marionette',
'Shared/Messenger',
'Mixins/AsModelBoundView'
], function (App, Marionette, Messenger, AsModelBoundView) {
], function (App, Marionette, AsModelBoundView) {
var view = Marionette.ItemView.extend({
template: 'Settings/Indexers/EditTemplate',
@ -20,27 +18,9 @@ define([
},
save: function () {
this.model.save(undefined, this.syncNotification("Indexer Saved", "Couldn't Save Indexer", this));
},
syncNotification: function (success, error, context) {
return {
success: function () {
Messenger.show({
message: success
});
context.indexerCollection.add(context.model);
App.modalRegion.closeModal();
},
error: function () {
window.alert(error);
}
};
this.model.saveSettings();
}
});
return AsModelBoundView.call(view);
});