summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-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":