summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-07-06 16:15:26 -0400
committerAlex Xu <alex_y_xu@yahoo.ca>2013-07-06 16:15:26 -0400
commitc191f104460a5b3f149863b2cdf9db3051f978c9 (patch)
tree0feb7c32a519c609f76b983aa79953de6933a4e2
parent0e14fea8ebc1730d6937bcc46354188a0a14f87c (diff)
downloadhtml5ks-c191f104460a5b3f149863b2cdf9db3051f978c9.tar.xz
html5ks-c191f104460a5b3f149863b2cdf9db3051f978c9.zip
fix menu... sorta
-rw-r--r--www/js/api.js2
-rw-r--r--www/js/imachine.js5
2 files changed, 4 insertions, 3 deletions
diff --git a/www/js/api.js b/www/js/api.js
index db09207..c8c495a 100644
--- a/www/js/api.js
+++ b/www/js/api.js
@@ -373,7 +373,7 @@ window.html5ks.api = {
choice.innerHTML = i;
choice.addEventListener("click", function () {
html5ks.elements.choices.innerHTML = "";
- deferred.resolve(choices[i]);
+ deferred.resolve(choices[this.innerHTML]);
}, false);
frag.appendChild(choice);
choice = choice.cloneNode(false);
diff --git a/www/js/imachine.js b/www/js/imachine.js
index adad442..1d539dd 100644
--- a/www/js/imachine.js
+++ b/www/js/imachine.js
@@ -12,7 +12,7 @@ html5ks.imachine = (function () {
},
run: function (label) {
var deferred = when.defer(),
- ilabel = typeof label === "string" ? html5ks.data.imachine[label] : label,
+ ilabel = typeof label === "string" ? html5ks.data.imachine[label] || label : label,
i = 0,
runInst = function () {
var inst = ilabel[i++];
@@ -40,7 +40,8 @@ html5ks.imachine = (function () {
break;
case "imenu":
html5ks.api.menu(args[0]).then(function (choice) {
- html5ks.imachine.run(args[1][choice] || args[1].else);
+ var next = args[1][choice] || args[1].else;
+ html5ks.imachine.run(typeof next[0] === "string" ? [next] : next);
});
break;
case "seen_scene":