From 1a9a7655c0bd9fdf8d77d1763aca8b67d2264e08 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sun, 4 Aug 2013 19:17:39 -0400 Subject: menu.js: rearrange code, add comments --- www/js/menu.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/www/js/menu.js b/www/js/menu.js index c7e7a3a..1e0e5a3 100644 --- a/www/js/menu.js +++ b/www/js/menu.js @@ -83,15 +83,6 @@ }, false); } - html5ks.elements.container.addEventListener("contextmenu", function (e) { - switch (html5ks.state.status) { - case "scene": - case "context": - this.context(); - } - e.preventDefault(); - }.bind(this), false); - this.elements.dialog.return.addEventListener("click", function (e) { html5ks.menu.activeDialog.style.display = "none"; html5ks.menu.activeDialog = null; @@ -104,6 +95,7 @@ e.stopPropagation(); }, false); + // quit var close = function () { window.close(); top.open('','_self',''); @@ -120,6 +112,16 @@ } }, this); + // context menu + html5ks.elements.container.addEventListener("contextmenu", function (e) { + switch (html5ks.state.status) { + case "scene": + case "context": + this.context(); + } + e.preventDefault(); + }.bind(this), false); + document.getElementById("context-return").addEventListener("click", function () { html5ks.menu.context(false); }, false); -- cgit v1.2.3-70-g09d2