From 6f96b4f9b19e54fba9e392347959e0e1ee68d876 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Thu, 22 Aug 2013 11:31:54 -0400 Subject: jshint --- www/js/imachine.js | 9 +++++---- www/js/menu.js | 10 ++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'www') 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) { -- cgit v1.2.3-54-g00ecf