From 8ec42b05f8766942590d38aa49a0d9ddeac839c3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 2 Feb 2024 13:47:53 +0100 Subject: [PATCH] js: Explicitly update history when col2 is closed Instead of doing this by default. There are too many cases where this isn't necessary at all. fixes #5178 --- public/js/icinga/behavior/actiontable.js | 1 + public/js/icinga/ui.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/icinga/behavior/actiontable.js b/public/js/icinga/behavior/actiontable.js index 0f914f7d7..074f46724 100644 --- a/public/js/icinga/behavior/actiontable.js +++ b/public/js/icinga/behavior/actiontable.js @@ -416,6 +416,7 @@ } else { if (_this.icinga.loader.getLinkTargetFor($tr).attr('id') === 'col2') { _this.icinga.ui.layout1col(); + _this.icinga.history.pushCurrentState(); } } diff --git a/public/js/icinga/ui.js b/public/js/icinga/ui.js index 0e6ee82ce..a872e7c34 100644 --- a/public/js/icinga/ui.js +++ b/public/js/icinga/ui.js @@ -303,6 +303,7 @@ this.currentLayout = matched[1]; if (this.currentLayout === 'poor' || this.currentLayout === 'minimal') { this.layout1col(); + this.icinga.history.replaceCurrentState(); } else if (this.icinga.initialized) { // layout1col() also triggers this, that's why an else is required $('#layout').trigger('layout-change'); @@ -351,7 +352,6 @@ delete $c[0].dataset.icingaContainerId; $c.removeAttr('class').attr('class', 'container'); $c.trigger('close-column'); - this.icinga.history.pushCurrentState(); $c.html(''); },