mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
JS/history: handle also requests out of containers
On login/logout (not only) we have requests not rendered to containers. History handling only cared about them and failed. fixes #6466
This commit is contained in:
parent
216c2ca770
commit
747083d322
@ -94,6 +94,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
pushUrl: function (url) {
|
||||||
|
// No history API, no action
|
||||||
|
if (!this.enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.history.pushState({icinga: true}, null, url);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event handler for pop events
|
* Event handler for pop events
|
||||||
*
|
*
|
||||||
|
@ -499,9 +499,16 @@
|
|||||||
// Update history when necessary. Don't do so for requests triggered
|
// Update history when necessary. Don't do so for requests triggered
|
||||||
// by history or autorefresh events
|
// by history or autorefresh events
|
||||||
if (! req.historyTriggered && ! req.autorefresh) {
|
if (! req.historyTriggered && ! req.autorefresh) {
|
||||||
// We only want to care about top-level containers
|
if (req.$target.hasClass('container')) {
|
||||||
if (req.$target.parent().closest('.container').length === 0) {
|
// We only want to care about top-level containers
|
||||||
this.icinga.history.pushCurrentState();
|
if (req.$target.parent().closest('.container').length === 0) {
|
||||||
|
this.icinga.history.pushCurrentState();
|
||||||
|
this.icinga.logger.info('Pushing state');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Request wasn't for a container, so it's usually the body
|
||||||
|
// or the full layout. Push request URL to history:
|
||||||
|
this.icinga.history.pushUrl(req.url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user