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
This commit is contained in:
Johannes Meyer 2024-02-02 13:47:53 +01:00
parent ff0fc55907
commit 8ec42b05f8
2 changed files with 2 additions and 1 deletions

View File

@ -416,6 +416,7 @@
} else { } else {
if (_this.icinga.loader.getLinkTargetFor($tr).attr('id') === 'col2') { if (_this.icinga.loader.getLinkTargetFor($tr).attr('id') === 'col2') {
_this.icinga.ui.layout1col(); _this.icinga.ui.layout1col();
_this.icinga.history.pushCurrentState();
} }
} }

View File

@ -303,6 +303,7 @@
this.currentLayout = matched[1]; this.currentLayout = matched[1];
if (this.currentLayout === 'poor' || this.currentLayout === 'minimal') { if (this.currentLayout === 'poor' || this.currentLayout === 'minimal') {
this.layout1col(); this.layout1col();
this.icinga.history.replaceCurrentState();
} else if (this.icinga.initialized) { } else if (this.icinga.initialized) {
// layout1col() also triggers this, that's why an else is required // layout1col() also triggers this, that's why an else is required
$('#layout').trigger('layout-change'); $('#layout').trigger('layout-change');
@ -351,7 +352,6 @@
delete $c[0].dataset.icingaContainerId; delete $c[0].dataset.icingaContainerId;
$c.removeAttr('class').attr('class', 'container'); $c.removeAttr('class').attr('class', 'container');
$c.trigger('close-column'); $c.trigger('close-column');
this.icinga.history.pushCurrentState();
$c.html(''); $c.html('');
}, },