repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 167e6c29eb8e4b0fc6c3f716bf4b4592131d671e:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 167e6c29eb8e4b0fc6c3f716bf4b4592131d671e
Author: James Baicoianu 
Date:   Sun Apr 18 23:03:44 2021 -0700

    Fixed error when nav ui app is "detached"

diff --git a/media/assets/webui/apps/navigation/navigation.js b/media/assets/webui/apps/navigation/navigation.js
index 445b40460e0684a1fe5335920bdec1d46c0c62b5..
index ..b6b12ea6c4442fcce5a432bd756e5a829d362eb9 100644
--- a/media/assets/webui/apps/navigation/navigation.js
+++ b/media/assets/webui/apps/navigation/navigation.js
@@ -15,12 +15,13 @@ elation.elements.define('janus.ui.navigation', class extends elation.elements.ui
   }
   getClient() {
     var node = this;
-    while (node) {
+    while (node && node !== document) {
       if (node.dataset['elationComponent'] == 'janusweb.client') {
         return elation.component.fetch(node);
       }
       node = node.parentNode
     }
+    return elation.component.fetch(document.querySelector('[data-elation-component="janusweb.client"]'));
   }
   updateCurrentURL() {
     var room = this.janusweb.currentroom;
@@ -84,12 +85,13 @@ elation.elements.define('janus.ui.statusindicator', class extends elation.elemen

   getClient() {
     var node = this;
-    while (node) {
+    while (node && node !== document) {
       if (node.dataset['elationComponent'] == 'janusweb.client') {
         return elation.component.fetch(node);
       }
       node = node.parentNode
     }
+    return elation.component.fetch(document.querySelector('[data-elation-component="janusweb.client"]'));
   }
   updateCurrentURL(room) {
     if (!room && this.janusweb.currentroom) {
@@ -331,12 +333,13 @@ elation.elements.define('janus.ui.urlbar', class extends elation.elements.ui.pan
   }
   getClient() {
     var node = this;
-    while (node) {
+    while (node && node !== document) {
       if (node.dataset['elationComponent'] == 'janusweb.client') {
         return elation.component.fetch(node);
       }
       node = node.parentNode
     }
+    return elation.component.fetch(document.querySelector('[data-elation-component="janusweb.client"]'));
   }
   updateRoom() {
     // Remove listeners from previous room

-----END OF PAGE-----