repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 6b113910761a84ce0761fd383e317632051efa21:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 6b113910761a84ce0761fd383e317632051efa21
Author: James Baicoianu 
Date:   Mon May 9 01:15:58 2016 -0700

    Return promise which executes when the engine has started

diff --git a/scripts/client.js b/scripts/client.js
index 8e115dc31434e09608337f69be5c544e6ce3ae75..
index ..0ab381938e1681ec46d947bb6995dbe874b1564c 100644
--- a/scripts/client.js
+++ b/scripts/client.js
@@ -16,7 +16,9 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
     document.head.appendChild(link);
     elation.html.addclass(document.body, 'dark');
     var janusweb = elation.janusweb.client({append: document.body, homepage: homepage});
-    return janusweb;
+    return new Promise(function(resolve, reject) {
+      elation.events.add(janusweb.engine, 'engine_start', function() { resolve(janusweb); });
+    });
   });
   elation.component.add('janusweb.client', function() {
     this.initEngine = function() {

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