diff options
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/api.js | 7 | ||||
-rw-r--r-- | www/js/menu.js | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/www/js/api.js b/www/js/api.js index 4c5a48f..44923ac 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -392,7 +392,7 @@ window.html5ks.api = { if (html5ks.state.skip || str.indexOf("{nw}") > -1) { html5ks.next(); } else if (html5ks.state.auto) { - setTimeout(html5ks.next, 1000 + html5ks.persistent.autospeed * text.length); + setTimeout(html5ks.next, 1000 + html5ks.persistent.autoModeDelay * text.length); } } return deferred.promise; @@ -465,5 +465,10 @@ window.html5ks.api = { html5ks.elements.choices.appendChild(frag); return deferred.promise; + }, + + speed: function (type, status) { + html5ks.state[type] = status; + document.getElementById(type).style.display = status ? "block" : "none"; } }; diff --git a/www/js/menu.js b/www/js/menu.js index c8e9bd4..c03212e 100644 --- a/www/js/menu.js +++ b/www/js/menu.js @@ -87,8 +87,8 @@ switch (html5ks.state.status) { case "scene": case "context": - html5ks.state.skip = false; - html5ks.state.auto = false; + html5ks.api.speed("skip", false); + html5ks.api.speed("auto", false); this.context(); } e.preventDefault(); @@ -136,13 +136,13 @@ document.getElementById("skip-mode").addEventListener("click", function () { html5ks.menu.context(false); - html5ks.state.skip = true; + html5ks.api.speed("skip", true); html5ks.next(); }, false); document.getElementById("auto-mode").addEventListener("click", function () { html5ks.menu.context(false); - html5ks.state.auto = true; + html5ks.api.speed("auto", true); html5ks.next(); }, false); |