summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamhed <samuel@cendio.se>2015-06-16 22:39:17 +0200
committersamhed <samuel@cendio.se>2015-06-16 22:41:29 +0200
commit29a0e6a8a3d091f075b1f1e941ee70651c245795 (patch)
tree77ebbf6b6f2721f995470f251f8978a6a52adf20
parent539955ff2753b9bb40e958d4b4eaea3c1d743cb3 (diff)
downloadnovnc-29a0e6a8a3d091f075b1f1e941ee70651c245795.tar.gz
Always show the viewport drag button on touch devices to keep the GUI from
"jumping around". Enable/disable the button instead of show/hide on these devices.
-rw-r--r--include/base.css4
-rw-r--r--include/ui.js13
2 files changed, 15 insertions, 2 deletions
diff --git a/include/base.css b/include/base.css
index 90c17e4..888b5f2 100644
--- a/include/base.css
+++ b/include/base.css
@@ -320,6 +320,10 @@ html {
/*box-shadow:inset 0.4px 0.4px 0.4px #000000;*/
}
+.noVNC_status_button:disabled {
+ opacity: 0.4;
+}
+
/*Settings Bubble*/
.triangle-right {
diff --git a/include/ui.js b/include/ui.js
index 3e7db63..ba04a85 100644
--- a/include/ui.js
+++ b/include/ui.js
@@ -697,6 +697,7 @@ var UI;
// State change disables viewport dragging.
// It is enabled (toggled) by direct click on the button
UI.setViewDrag(false);
+ UI.updateViewDragButton();
switch (UI.rfb_state) {
case 'fatal':
@@ -889,8 +890,6 @@ var UI;
setViewDrag: function(drag) {
if (!UI.rfb) return;
- UI.updateViewDragButton();
-
if (typeof(drag) === "undefined" ||
typeof(drag) === "object") {
// If not specified, then toggle
@@ -911,8 +910,18 @@ var UI;
if (UI.rfb_state === 'normal' &&
UI.rfb.get_display().get_viewport() &&
UI.rfb.get_display().clippingDisplay()) {
+ // Enable the viewport drag button
vmb.style.display = "inline";
+ vmb.disabled = false;
+
+ } else if (UI.rfb_state === 'normal' &&
+ UI.isTouchDevice) {
+ // Disable the viewport drag button
+ vmb.style.display = "inline";
+ vmb.disabled = true;
+
} else {
+ // Hide the viewport drag button
vmb.style.display = "none";
}
},