diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2013-08-03 16:21:37 -0400 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2013-08-03 16:35:16 -0400 |
commit | d47fade7099b96fdabb3a5fd3d6196b9a66ce49e (patch) | |
tree | 687ac3a3af17007c71263c468e6b5bcd2bd9d6d7 /www/js/menu.js | |
parent | e3e9a0947a2b04348cc9b77aff054960485b4393 (diff) | |
download | html5ks-d47fade7099b96fdabb3a5fd3d6196b9a66ce49e.tar.xz html5ks-d47fade7099b96fdabb3a5fd3d6196b9a66ce49e.zip |
fix stuff
Diffstat (limited to 'www/js/menu.js')
-rw-r--r-- | www/js/menu.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/www/js/menu.js b/www/js/menu.js index c03212e..b940b30 100644 --- a/www/js/menu.js +++ b/www/js/menu.js @@ -43,7 +43,7 @@ var options = document.getElementsByClassName("option"); var change = function (e) { var target = e.target; - values[target.id] = target.type === "checkbox" ? target.checked : target.value; + html5ks.persistent[target.id] = target.type === "checkbox" ? target.checked : target.value; switch (target.id) { case "fullscreen": if (target.checked) { @@ -87,8 +87,6 @@ switch (html5ks.state.status) { case "scene": case "context": - html5ks.api.speed("skip", false); - html5ks.api.speed("auto", false); this.context(); } e.preventDefault(); @@ -106,16 +104,17 @@ e.stopPropagation(); }, false); + var close = function () { + window.close(); + top.open('','_self',''); + top.close(); + }; ["AppleWebKit", "MSIE", "Trident"].forEach(function (ua) { if (navigator.userAgent.indexOf(ua) > -1) { var quit = document.getElementsByClassName("quit"); - for (var i = quit.length - 1; i >= 0; i++) { - quit[i].className = quit.className.replace("disabled", ""); - quit[i].addEventListener("click", function () { - window.close(); - top.open('','_self',''); - top.close(); - }, false); + for (var i = quit.length - 1; i >= 0; i--) { + quit[i].className = quit[i].className.replace("disabled", ""); + quit[i].addEventListener("click", close, false); } return false; } @@ -197,6 +196,7 @@ context: function (show, transitional) { switch (show) { case true: + this._hadWindow = html5ks.elements.window.style.display !== "none"; html5ks.state.status = "context"; html5ks.elements.gray.style.display = "block"; html5ks.elements.window.style.display = "none"; @@ -205,7 +205,7 @@ case false: html5ks.state.status = "scene"; html5ks.elements.gray.style.display = "none"; - if (html5ks.state.status === "scene") { + if (html5ks.state.status === "scene" && this._hadWindow) { html5ks.elements.window.style.display = "block"; } this.elements.context.style.display = "none"; |