diff options
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/api.js | 6 | ||||
-rw-r--r-- | www/js/menu.js | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/www/js/api.js b/www/js/api.js index e5a6a58..b50f4c3 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -92,16 +92,18 @@ window.html5ks.api = { }, iscene: function (target, is_h, is_end) { this.scene_register(target); - var label = html5ks.data.script[target], + var deferred = when.defer(), + label = html5ks.data.script[target], i = 0; (function run() { if (label[i]) { html5ks.api.runInst(label[i]).then(run, console.error); i++; } else { - html5ks.mainMenu(); + deferred.resolve(); } }()); + return deferred.promise; }, window: function (action, transition) { diff --git a/www/js/menu.js b/www/js/menu.js index 8d68fcd..ad37964 100644 --- a/www/js/menu.js +++ b/www/js/menu.js @@ -20,7 +20,7 @@ html5ks.menu = { initEvents: function () { document.getElementById("start").addEventListener("click", function () { html5ks.elements.mainMenu.style.display = "none"; - html5ks.api.iscene("en_NOP1"); + html5ks.api.iscene("en_NOP1").then(html5ks.menu.mainMenu); }, false); document.getElementById("options-button").addEventListener("click", function () { html5ks.menu.dialog("options"); |