diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index ca416b38f..96bf18a20 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -786,8 +786,23 @@ if (!! contentSeparator) { var locationQuery = req.getResponseHeader('X-Icinga-Location-Query'); if (locationQuery !== null) { - var a = this.icinga.utils.getUrlHelper(); + var a = this.icinga.utils.getUrlHelper().cloneNode(true); a.search = locationQuery ? '?' + locationQuery : ''; + + if (autoSubmit) { + // Also update a form's action if it doesn't differ from the container's url + var $form = $(referrer.forceFocus).closest('form'); + var formAction = $form.attr('action'); + if (!! formAction) { + formAction = this.icinga.utils.parseUrl(formAction); + if (formAction.path === currentUrl.path + && this.icinga.utils.arraysEqual(formAction.params, currentUrl.params) + ) { + $form.attr('action', a.href); + } + } + } + req.$target.data('icingaUrl', a.href); this.icinga.history.replaceCurrentState(); }