|
|
@ -11,6 +11,10 @@ define(
|
|
|
|
var view = Marionette.ItemView.extend({
|
|
|
|
var view = Marionette.ItemView.extend({
|
|
|
|
template: 'Settings/Indexers/EditTemplate',
|
|
|
|
template: 'Settings/Indexers/EditTemplate',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ui : {
|
|
|
|
|
|
|
|
activity: '.x-activity'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
events: {
|
|
|
|
events: {
|
|
|
|
'click .x-save' : '_save',
|
|
|
|
'click .x-save' : '_save',
|
|
|
|
'click .x-save-and-add': '_saveAndAdd'
|
|
|
|
'click .x-save-and-add': '_saveAndAdd'
|
|
|
@ -21,6 +25,8 @@ define(
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
_save: function () {
|
|
|
|
_save: function () {
|
|
|
|
|
|
|
|
this.ui.activity.html('<i class="icon-nd-spinner"></i>');
|
|
|
|
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
var self = this;
|
|
|
|
var promise = this.model.saveSettings();
|
|
|
|
var promise = this.model.saveSettings();
|
|
|
|
|
|
|
|
|
|
|
@ -29,10 +35,16 @@ define(
|
|
|
|
self.indexerCollection.add(self.model, { merge: true });
|
|
|
|
self.indexerCollection.add(self.model, { merge: true });
|
|
|
|
App.vent.trigger(App.Commands.CloseModalCommand);
|
|
|
|
App.vent.trigger(App.Commands.CloseModalCommand);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
promise.always(function () {
|
|
|
|
|
|
|
|
self.ui.activity.empty();
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
_saveAndAdd: function () {
|
|
|
|
_saveAndAdd: function () {
|
|
|
|
|
|
|
|
this.ui.activity.html('<i class="icon-nd-spinner"></i>');
|
|
|
|
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
var self = this;
|
|
|
|
var promise = this.model.saveSettings();
|
|
|
|
var promise = this.model.saveSettings();
|
|
|
|
|
|
|
|
|
|
|
@ -50,6 +62,10 @@ define(
|
|
|
|
self.model.set('fields.' + key + '.value', '');
|
|
|
|
self.model.set('fields.' + key + '.value', '');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
promise.always(function () {
|
|
|
|
|
|
|
|
self.ui.activity.empty();
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|