js/loader: support multi-container redirection

Redirections to #!-separated URLs (multiple containers) should also
work when not re-rendering the whole layout.
This commit is contained in:
Thomas Gelf 2014-11-01 01:23:55 +01:00
parent 6298d303c4
commit 95f9bebdc5
1 changed files with 17 additions and 8 deletions

View File

@ -269,15 +269,24 @@
}
} else {
if (req.$target.attr('id') === 'col2') { // TODO: multicol
if ($('#col1').data('icingaUrl') === redirect) {
icinga.ui.layout1col();
req.$target = $('#col1');
delete(this.requests['col2']);
}
}
this.loadUrl(redirect, req.$target);
if (redirect.match(/#!/)) {
var parts = redirect.split(/#!/);
icinga.ui.layout2col();
this.loadUrl(parts.shift(), $('#col1'));
this.loadUrl(parts.shift(), $('#col2'));
} else {
if (req.$target.attr('id') === 'col2') { // TODO: multicol
if ($('#col1').data('icingaUrl') === redirect) {
icinga.ui.layout1col();
req.$target = $('#col1');
delete(this.requests['col2']);
}
}
this.loadUrl(redirect, req.$target);
}
}
return true;
},