mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
js/forms: treat buttons like input-buttons
This fixes a few autosubmission-detection woes.
This commit is contained in:
parent
e4180e3e38
commit
f32eab627a
@ -292,13 +292,12 @@
|
|||||||
submitForm: function (event, autosubmit) {
|
submitForm: function (event, autosubmit) {
|
||||||
var self = event.data.self;
|
var self = event.data.self;
|
||||||
var icinga = self.icinga;
|
var icinga = self.icinga;
|
||||||
|
|
||||||
// .closest is not required unless subelements to trigger this
|
// .closest is not required unless subelements to trigger this
|
||||||
var $form = $(event.currentTarget).closest('form');
|
var $form = $(event.currentTarget).closest('form');
|
||||||
var regex = new RegExp('&', 'g');
|
var regex = new RegExp('&', 'g');
|
||||||
var url = $form.attr('action').replace(regex, '&'); // WHY??
|
var url = $form.attr('action').replace(regex, '&'); // WHY??
|
||||||
var method = $form.attr('method');
|
var method = $form.attr('method');
|
||||||
var $button = $('input[type=submit]:focus', $form);
|
var $button = $('input[type=submit]:focus', $form).add('button[type=submit]:focus', $form);
|
||||||
var $target;
|
var $target;
|
||||||
var data;
|
var data;
|
||||||
|
|
||||||
|
@ -233,6 +233,10 @@
|
|||||||
if (this.exception !== null) {
|
if (this.exception !== null) {
|
||||||
this.exception.remove();
|
this.exception.remove();
|
||||||
this.exception = null;
|
this.exception = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove 'impact' class if there was such
|
||||||
|
if (req.$target.hasClass('impact')) {
|
||||||
req.$target.removeClass('impact');
|
req.$target.removeClass('impact');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,11 +349,6 @@
|
|||||||
this.icinga.ui.setWindowId(windowId);
|
this.icinga.ui.setWindowId(windowId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove 'impact' class if there was such
|
|
||||||
if (req.$target.hasClass('impact')) {
|
|
||||||
req.$target.removeClass('impact');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle search requests, still hardcoded.
|
// Handle search requests, still hardcoded.
|
||||||
if (req.url.match(/^\/search/) &&
|
if (req.url.match(/^\/search/) &&
|
||||||
req.$target.data('icingaUrl').match(/^\/search/) &&
|
req.$target.data('icingaUrl').match(/^\/search/) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user