diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2013-08-22 11:31:54 -0400 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2013-08-22 11:31:54 -0400 |
commit | 6f96b4f9b19e54fba9e392347959e0e1ee68d876 (patch) | |
tree | 9d98b4fce255086fdf6caada260170802ec43809 | |
parent | e526f3df818ea21760c5eeb4e2f728845bb93140 (diff) | |
download | html5ks-6f96b4f9b19e54fba9e392347959e0e1ee68d876.tar.xz html5ks-6f96b4f9b19e54fba9e392347959e0e1ee68d876.zip |
jshint
-rw-r--r-- | www/js/imachine.js | 9 | ||||
-rw-r--r-- | www/js/menu.js | 10 |
2 files changed, 11 insertions, 8 deletions
diff --git a/www/js/imachine.js b/www/js/imachine.js index 5e21ac6..5e8423c 100644 --- a/www/js/imachine.js +++ b/www/js/imachine.js @@ -53,13 +53,14 @@ html5ks.imachine = (function () { break; case "if": var cpy = inst.slice(0), - type = ''; + type = '', + next = null; el: while (type = cpy.shift()) { switch (type) { case "if": case "elif": - var cond = cpy.shift(), - next = cpy.shift(); + var cond = cpy.shift(); + next = cpy.shift(); switch (cond[0]) { case "_return": if (this._return == cond[1]) { @@ -77,6 +78,7 @@ html5ks.imachine = (function () { if (html5ks.store.attraction[cond[0]] > cond[1]) { break el; } + break; default: throw new Error("unhandled if statement"); } @@ -87,7 +89,6 @@ html5ks.imachine = (function () { } } return html5ks.imachine.run(next).then(runInst); - break; case "path_end": // TODO: disp vid + add to persistent deferred.resolve(); diff --git a/www/js/menu.js b/www/js/menu.js index e4a8b2c..6f2fbf3 100644 --- a/www/js/menu.js +++ b/www/js/menu.js @@ -76,11 +76,13 @@ var optionsButton = document.getElementsByClassName("options-button"); + var showOptions = function (e) { + html5ks.menu.dialog("options"); + e.stopPropagation(); + }; + for (var i = optionsButton.length - 1; i >= 0; i--) { - optionsButton[i].addEventListener("click", function (e) { - html5ks.menu.dialog("options"); - e.stopPropagation(); - }, false); + optionsButton[i].addEventListener("click", showOptions, false); } this.elements.dialog.return.addEventListener("click", function (e) { |