From cb6a0c120fc2ac902263b199f8c13a027326cc01 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 19 May 2023 13:15:38 +0200 Subject: [PATCH] events.js: Trigger a real submit upon autosubmit --- public/js/icinga/events.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 186a41c7c..1878d8f60 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -183,7 +183,17 @@ }, autoSubmitForm: function (event) { - return event.data.self.submitForm(event, $(event.currentTarget)); + let form = event.currentTarget.form; + + if (form.closest('[data-no-icinga-ajax]')) { + return; + } + + form.dispatchEvent(new CustomEvent('submit', { + cancelable: true, + bubbles: true, + detail: { submittedBy: event.currentTarget } + })); }, /**