summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-08-04 19:17:39 -0400
committerAlex Xu <alex_y_xu@yahoo.ca>2013-08-04 19:17:39 -0400
commit1a9a7655c0bd9fdf8d77d1763aca8b67d2264e08 (patch)
tree4dded7d4eac31624a535a4d74819471f5a17c64f /www
parentf1453c8cb16b620b56504be26f74bb162a01110a (diff)
downloadhtml5ks-1a9a7655c0bd9fdf8d77d1763aca8b67d2264e08.tar.xz
html5ks-1a9a7655c0bd9fdf8d77d1763aca8b67d2264e08.zip
menu.js: rearrange code, add comments
Diffstat (limited to 'www')
-rw-r--r--www/js/menu.js20
1 files 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);