JS: Fix don't close the right column when submitting a form if not requested

This commit is contained in:
Yonas Habteab 2021-09-14 17:25:59 +02:00
parent 869b63c263
commit 8364cd83b0

View File

@ -599,10 +599,12 @@
rerenderLayout, rerenderLayout,
autoRefreshInterval, autoRefreshInterval,
forceFocus, forceFocus,
origin; origin,
shiftRightColumn;
if (typeof referrer !== 'undefined') { if (typeof referrer !== 'undefined') {
rerenderLayout = referrer.getResponseHeader('X-Icinga-Rerender-Layout'); rerenderLayout = referrer.getResponseHeader('X-Icinga-Rerender-Layout');
shiftRightColumn = referrer.getResponseHeader('X-Icinga-Shift-RightColumn');
autoRefreshInterval = referrer.autoRefreshInterval; autoRefreshInterval = referrer.autoRefreshInterval;
forceFocus = referrer.forceFocus; forceFocus = referrer.forceFocus;
origin = referrer.url; origin = referrer.url;
@ -643,7 +645,7 @@
this.loadUrl(parts.shift(), $('#col2')); this.loadUrl(parts.shift(), $('#col2'));
} else { } else {
if ($target.attr('id') === 'col2') { // TODO: multicol if ($target.attr('id') === 'col2') { // TODO: multicol
if ($('#col1').data('icingaUrl').split('?')[0] === url.split('?')[0]) { if ($('#col1').data('icingaUrl').split('?')[0] === url.split('?')[0] && shiftRightColumn !== 'false') {
icinga.ui.layout1col(); icinga.ui.layout1col();
$target = $('#col1'); $target = $('#col1');
delete(this.requests['col2']); delete(this.requests['col2']);