mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 07:14:35 +02:00
js/loader: handle form redirections automagically
An XHR redirection in a right-side container pointing to the URL shown on the left should close it's own container and refresh the lefthand one. refs #6436 fixes #6435
This commit is contained in:
parent
f3172b96e4
commit
590db51255
@ -244,9 +244,10 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
processRedirectHeader: function(req) {
|
processRedirectHeader: function(req) {
|
||||||
|
var icinga = this.icinga;
|
||||||
var redirect = req.getResponseHeader('X-Icinga-Redirect');
|
var redirect = req.getResponseHeader('X-Icinga-Redirect');
|
||||||
if (! redirect) return false;
|
if (! redirect) return false;
|
||||||
this.icinga.logger.debug(
|
icinga.logger.debug(
|
||||||
'Got redirect for ', req.$target, ', URL was ' + redirect
|
'Got redirect for ', req.$target, ', URL was ' + redirect
|
||||||
);
|
);
|
||||||
redirect = decodeURIComponent(redirect);
|
redirect = decodeURIComponent(redirect);
|
||||||
@ -255,6 +256,13 @@
|
|||||||
var redirectionUrl = this.addUrlFlag(redirect, 'renderLayout');
|
var redirectionUrl = this.addUrlFlag(redirect, 'renderLayout');
|
||||||
this.loadUrl(redirectionUrl, $('#layout')).url = redirect;
|
this.loadUrl(redirectionUrl, $('#layout')).url = redirect;
|
||||||
} else {
|
} else {
|
||||||
|
if (req.$target.attr('id') === 'col2') { // TODO: multicol
|
||||||
|
if ($('#col1').data('icingaUrl') === redirect) {
|
||||||
|
icinga.ui.layout1col();
|
||||||
|
req.$target = $('#col1');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.loadUrl(redirect, req.$target);
|
this.loadUrl(redirect, req.$target);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user