diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2013-06-27 23:11:16 -0400 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2013-06-27 23:11:16 -0400 |
commit | 012ac4ef2f91ed67d36c5e06510cec8c00517de3 (patch) | |
tree | 944e2c375770e1757fa92d2bbe942e8e27965c2f /www/js | |
parent | f3a9805dc55133320a48feb094475aa9bd84bcac (diff) | |
download | html5ks-012ac4ef2f91ed67d36c5e06510cec8c00517de3.tar.xz html5ks-012ac4ef2f91ed67d36c5e06510cec8c00517de3.zip |
jmp to main menu after en_NOP1, dec version
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"); |