events.js: Trigger a real submit upon autosubmit

This commit is contained in:
Johannes Meyer 2023-05-19 13:15:38 +02:00
parent 7da5eb0972
commit cb6a0c120f
1 changed files with 11 additions and 1 deletions

View File

@ -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 }
}));
},
/**