loader.js: Allow to override the actual form action using formaction attr

This commit is contained in:
Yonas Habteab 2022-03-11 16:21:11 +01:00
parent f19369ef03
commit 3c55422fa7

View File

@ -89,6 +89,11 @@
$target = this.getLinkTargetFor($form); $target = this.getLinkTargetFor($form);
} }
// Overwrite the URL only if the form is not auto submitted
if ($button.hasAttr('formaction') && ! $autoSubmittedBy) {
url = $button.attr('formaction');
}
if (! url) { if (! url) {
// Use the URL of the target container if the form's action is not set // Use the URL of the target container if the form's action is not set
url = $target.closest('.container').data('icinga-url'); url = $target.closest('.container').data('icinga-url');