From 3c55422fa7f4dd9be0772b453cbdf356481fb83d Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 11 Mar 2022 16:21:11 +0100 Subject: [PATCH] `loader.js`: Allow to override the actual form action using `formaction` attr --- public/js/icinga/loader.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index f038dc7c8..8d69fe826 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -89,6 +89,11 @@ $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) { // Use the URL of the target container if the form's action is not set url = $target.closest('.container').data('icinga-url');