mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
js: Do not re-open the detail url if it's the origin of a redirect
refs #5600
This commit is contained in:
parent
086579b254
commit
67a28a4b47
@ -331,7 +331,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.redirectToUrl(redirect, req.$target, req.getResponseHeader('X-Icinga-Rerender-Layout'));
|
this.redirectToUrl(redirect, req.$target, req.url, req.getResponseHeader('X-Icinga-Rerender-Layout'));
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -340,9 +340,10 @@
|
|||||||
*
|
*
|
||||||
* @param {string} url
|
* @param {string} url
|
||||||
* @param {object} $target
|
* @param {object} $target
|
||||||
|
* @param {string] origin
|
||||||
* @param {boolean} rerenderLayout
|
* @param {boolean} rerenderLayout
|
||||||
*/
|
*/
|
||||||
redirectToUrl: function (url, $target, rerenderLayout) {
|
redirectToUrl: function (url, $target, origin, rerenderLayout) {
|
||||||
var icinga = this.icinga;
|
var icinga = this.icinga;
|
||||||
|
|
||||||
if (typeof rerenderLayout === 'undefined') {
|
if (typeof rerenderLayout === 'undefined') {
|
||||||
@ -365,7 +366,15 @@
|
|||||||
// Retain detail URL if the layout is rerendered
|
// Retain detail URL if the layout is rerendered
|
||||||
parts = document.location.hash.split('#!').splice(1);
|
parts = document.location.hash.split('#!').splice(1);
|
||||||
if (parts.length) {
|
if (parts.length) {
|
||||||
r.loadNext = parts;
|
r.loadNext = $.grep(parts, function (url) {
|
||||||
|
if (url !== origin) {
|
||||||
|
icinga.logger.debug('Retaining detail url ' + url);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
icinga.logger.debug('Discarding detail url ' + url + ' as it\'s the origin of the redirect');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -609,7 +618,7 @@
|
|||||||
|
|
||||||
this.processRedirectHeader(req);
|
this.processRedirectHeader(req);
|
||||||
|
|
||||||
if (typeof req.loadNext !== 'undefined') {
|
if (typeof req.loadNext !== 'undefined' && req.loadNext.length) {
|
||||||
if ($('#col2').length) {
|
if ($('#col2').length) {
|
||||||
this.loadUrl(req.loadNext[0], $('#col2'));
|
this.loadUrl(req.loadNext[0], $('#col2'));
|
||||||
this.icinga.ui.layout2col();
|
this.icinga.ui.layout2col();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user