Skip to content

Commit

Permalink
js/loader: support multi-container redirection
Browse files Browse the repository at this point in the history
Redirections to #!-separated URLs (multiple containers) should also
work when not re-rendering the whole layout.
  • Loading branch information
Thomas-Gelf committed Nov 1, 2014
1 parent 6298d30 commit 95f9beb
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions public/js/icinga/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

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);
this.loadUrl(redirect, req.$target);
}
}
return true;
},
Expand Down

0 comments on commit 95f9beb

Please sign in to comment.