mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +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) {
|
||||
var self = event.data.self;
|
||||
var icinga = self.icinga;
|
||||
|
||||
// .closest is not required unless subelements to trigger this
|
||||
var $form = $(event.currentTarget).closest('form');
|
||||
var regex = new RegExp('&', 'g');
|
||||
var url = $form.attr('action').replace(regex, '&'); // WHY??
|
||||
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 data;
|
||||
|
||||
|
@ -233,6 +233,10 @@
|
||||
if (this.exception !== null) {
|
||||
this.exception.remove();
|
||||
this.exception = null;
|
||||
}
|
||||
|
||||
// Remove 'impact' class if there was such
|
||||
if (req.$target.hasClass('impact')) {
|
||||
req.$target.removeClass('impact');
|
||||
}
|
||||
|
||||
@ -345,11 +349,6 @@
|
||||
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.
|
||||
if (req.url.match(/^\/search/) &&
|
||||
req.$target.data('icingaUrl').match(/^\/search/) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user