From fae5867dcfe0ef6e05a63ccfc43673adb3566326 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 8 Apr 2012 16:11:17 -0700 Subject: [PATCH] Pop up menu in center, but do not rely on position: fixed. --- src/main/webapp/client.xhtml | 14 ++++---------- src/main/webapp/scripts/interface.js | 12 ++++++++++++ src/main/webapp/styles/client.css | 5 +++++ 3 files changed, 21 insertions(+), 10 deletions(-) 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 -- 1.7.10.4