From: Michael Jumper Date: Sun, 8 Apr 2012 23:11:17 +0000 (-0700) Subject: Pop up menu in center, but do not rely on position: fixed. X-Git-Url: http://git.alex.org.uk Pop up menu in center, but do not rely on position: fixed. --- diff --git a/src/main/webapp/client.xhtml b/src/main/webapp/client.xhtml index ce52831..312d3c3 100644 --- a/src/main/webapp/client.xhtml +++ b/src/main/webapp/client.xhtml @@ -85,16 +85,10 @@ -
-
- -
- - - -
- -
+
+ + +
diff --git a/src/main/webapp/scripts/interface.js b/src/main/webapp/scripts/interface.js index ee0f497..e010272 100644 --- a/src/main/webapp/scripts/interface.js +++ b/src/main/webapp/scripts/interface.js @@ -142,7 +142,19 @@ var GuacamoleUI = { }; GuacamoleUI.showTouchMenu = function() { + + GuacamoleUI.touchMenu.style.left = + ((GuacamoleUI.viewport.offsetWidth - GuacamoleUI.touchMenu.offsetWidth) / 2 + + window.pageXOffset) + + "px"; + + GuacamoleUI.touchMenu.style.top = + ((GuacamoleUI.viewport.offsetHeight - GuacamoleUI.touchMenu.offsetHeight) / 2 + + window.pageYOffset) + + "px"; + GuacamoleUI.touchMenu.style.visibility = "visible"; + }; GuacamoleUI.shadeMenu = function() { diff --git a/src/main/webapp/styles/client.css b/src/main/webapp/styles/client.css index ebed759..7ed9c77 100644 --- a/src/main/webapp/styles/client.css +++ b/src/main/webapp/styles/client.css @@ -260,9 +260,14 @@ textarea#eventTarget { /* Touch-specific menu */ div#touchMenu { + + position: absolute; + visibility: hidden; + display: inline-block; background: black; border: 1px solid silver; padding: 1em; opacity: 0.8; + } \ No newline at end of file