Fix unresponsive modal submit buttons in Safari

This commit is contained in:
raviks789 2021-11-09 16:21:35 +01:00 committed by Johannes Meyer
parent 457b6f6971
commit 703956c3da
2 changed files with 14 additions and 5 deletions

View File

@ -96,7 +96,16 @@
var $form = $(event.currentTarget).closest('form');
var $modal = $form.closest('#modal');
var req = _this.icinga.loader.submitForm($form, $autoSubmittedBy);
var $button;
var $rememberedSubmittButton = $form.data('submitButton');
if (typeof $rememberedSubmittButton != 'undefined') {
if ($form.has($rememberedSubmittButton)) {
$button = $rememberedSubmittButton;
}
$form.removeData('submitButton');
}
var req = _this.icinga.loader.submitForm($form, $autoSubmittedBy, $button);
req.addToHistory = false;
req.$redirectTarget = $modal.data('redirectTarget');
req.done(function (data, textStatus, req) {

View File

@ -195,6 +195,10 @@
// .closest is not required unless subelements to trigger this
var $form = $(event.currentTarget).closest('form');
if ($form.closest('[data-no-icinga-ajax]').length > 0) {
return true;
}
var $button;
var $rememberedSubmittButton = $form.data('submitButton');
if (typeof $rememberedSubmittButton != 'undefined') {
@ -204,10 +208,6 @@
$form.removeData('submitButton');
}
if ($form.closest('[data-no-icinga-ajax]').length > 0) {
return true;
}
if (typeof $button === 'undefined') {
var $el;