var DialogView = Backbone.View.extend({
template: _.template(dialogTemplate),
events: {
- 'click .save-btn': 'onSave',
+ 'click .execute-btn': 'onExecute',
'click .cancel-btn': 'onCancel',
'click .close': 'close'
},
},
show: function() {
this.setElement(this.template(_.extend({
- submitButtonText: gettext('Submit'),
+ executeButtonText: gettext('Submit'),
cancelButtonText: gettext('Cancel')
}, this.options)));
this.$el.modal('show');
this.$('textarea').focus();
},
- onSave: function(e) {
+ onExecute: function(e) {
e.preventDefault();
var view = this,
formData = {};
formData[field.name] = widget.val();
});
- this.trigger('save', {
+ this.trigger('execute', {
formData: formData,
success: function() { view.actionsDisabled = false; view.close(); },
error: function() { view.actionsDisabled = false; view.close(); },