Browse Source

HUE-3294 [core] Fix url parameter content detection

Johan Ahlen 9 years ago
parent
commit
43097fa
1 changed files with 6 additions and 7 deletions
  1. 6 7
      desktop/core/src/desktop/templates/responsive.mako

+ 6 - 7
desktop/core/src/desktop/templates/responsive.mako

@@ -327,7 +327,7 @@ ${ assist.assistPanel() }
 
         self.embeddable_cache = {};
 
-        self.currentApp = ko.observable('');
+        self.currentApp = ko.observable();
         self.isLoadingEmbeddable = ko.observable(false);
 
         self.currentApp.subscribe(function(newVal){
@@ -349,13 +349,16 @@ ${ assist.assistPanel() }
                 self.isLoadingEmbeddable(false);
               }
             });
-          }
-          else {
+          } else {
             $('#embeddable').html(self.embeddable_cache[newVal]);
             self.isLoadingEmbeddable(false);
           }
         });
 
+        if (window.location.getParameter('editor') !== '' || window.location.getParameter('type') !== ''){
+          self.currentApp('editor');
+        }
+
         huePubSub.subscribe('switch.app', function (name) {
           console.log(name);
           self.currentApp(name);
@@ -414,10 +417,6 @@ ${ assist.assistPanel() }
         return ko.dataFor($('.top-nav')[0]);
       }
     };
-
-    if (window.location.getParameter('editor') !== '' || window.location.getParameter('type') !== ''){
-      opvm.currentApp('editor');
-    }
   });
 
   $(".hamburger").click(function () {