[icinga-checkins] icinga.org: icingaweb2/feature/setup-wizard-7163: js/loader: support multi-container redirection

git at icinga.org git at icinga.org
Tue Nov 4 14:25:53 CET 2014


Module: icingaweb2
Branch: feature/setup-wizard-7163
Commit: 95f9bebdc5effb2f007902c11a6423b18753837a
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=95f9bebdc5effb2f007902c11a6423b18753837a

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sat Nov  1 01:23:55 2014 +0100

js/loader: support multi-container redirection

Redirections to #!-separated URLs (multiple containers) should also
work when not re-rendering the whole layout.

---

 public/js/icinga/loader.js |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js
index 7fbe8ba..31a0d10 100644
--- a/public/js/icinga/loader.js
+++ b/public/js/icinga/loader.js
@@ -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;
         },



More information about the icinga-checkins mailing list