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) {
|
||||
var icinga = this.icinga;
|
||||
var redirect = req.getResponseHeader('X-Icinga-Redirect');
|
||||
if (! redirect) return false;
|
||||
this.icinga.logger.debug(
|
||||
icinga.logger.debug(
|
||||
'Got redirect for ', req.$target, ', URL was ' + redirect
|
||||
);
|
||||
redirect = decodeURIComponent(redirect);
|
||||
|
@ -255,6 +256,13 @@
|
|||
var redirectionUrl = this.addUrlFlag(redirect, 'renderLayout');
|
||||
this.loadUrl(redirectionUrl, $('#layout')).url = redirect;
|
||||
} 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);
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue