repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 831f5793e24570dadee69490e3a7bf537d2c13de:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 831f5793e24570dadee69490e3a7bf537d2c13de
Author: James Baicoianu 
Date:   Fri Feb 8 13:00:08 2019 -0800

    Delay custom element initialization until assetpack is loaded

diff --git a/scripts/janusweb.js b/scripts/janusweb.js
index e05ab4ca4cdf5dd11a076549767392f887ed5e27..
index ..e437732534388ff4033ec2724e13058a51800b09 100644
--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -112,7 +112,10 @@ elation.require([
       }
       this.initScripting();
       // TODO - this should be config-driven
-      this.registerAdditionalElements(['raycaster', 'teleporter']);
+
+      this.assetpack.executeWhenLoaded(() => {
+        this.registerAdditionalElements(['raycaster', 'teleporter']);
+      });
     }
     this.initScripting = function() {
       if (this.scriptingInitialized) return;

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