From 79ee00176e421db8ac098be7d10e77af84d50f78 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 27 Sep 2021 14:09:24 +0200 Subject: [PATCH] modal.js: Don't disable inputs before the actual form submit is done fixes Icinga/icingadb-web#376 (cherry picked from commit dcf394eaa692a006012566c1be0db868e1b74675) --- public/js/icinga/behavior/modal.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/js/icinga/behavior/modal.js b/public/js/icinga/behavior/modal.js index 3f734c4af..68f895561 100644 --- a/public/js/icinga/behavior/modal.js +++ b/public/js/icinga/behavior/modal.js @@ -95,8 +95,6 @@ var _this = event.data.self; var $form = $(event.currentTarget).closest('form'); var $modal = $form.closest('#modal'); - // otherwise the form is submitted several times by clicking the "Submit" button several times - $form.find('input:not(:disabled)').prop('disabled', true); var req = _this.icinga.loader.submitForm($form, $autoSubmittedBy); req.addToHistory = false; @@ -107,6 +105,9 @@ } }); + // otherwise the form is submitted several times by clicking the "Submit" button several times + $form.find('input:not(:disabled)').prop('disabled', true); + event.stopPropagation(); event.preventDefault(); return false;