No automagic button for autosubmitted form

This commit is contained in:
Thomas Gelf 2014-03-09 23:38:55 +01:00
parent fcd05dfe81
commit 347186e282
1 changed files with 9 additions and 3 deletions

View File

@ -86,7 +86,7 @@
$(document).on('submit', 'form', { self: this }, this.submitForm);
// We support an 'autosubmit' class on dropdown form elements
$(document).on('change', 'form select.autosubmit', { self: this }, this.submitForm);
$(document).on('change', 'form select.autosubmit', { self: this }, this.autoSubmitForm);
$(document).on('keyup', '#menu input.search', {self: this}, this.submitForm);
@ -121,10 +121,14 @@
$(this).removeClass('hover');
},
autoSubmitForm: function (event) {
return event.data.self.submitForm(event, true);
},
/**
*
*/
submitForm: function (event) {
submitForm: function (event, autosubmit) {
var self = event.data.self;
var icinga = self.icinga;
@ -139,7 +143,9 @@
event.preventDefault();
// TODO: Check button
data.push({ name: 'btn_submit', value: 'yesss' });
if (typeof autosubmit === 'undefined' || ! autosubmit) {
data.push({ name: 'btn_submit', value: 'yesss' });
}
icinga.logger.debug('Submitting form: ' + method + ' ' + url);