Add hint that the control bar can be moved

The control bar can be dragged to the other side, this isn't obvious
however. This adds a hint on the opposite side in the form of a subtle
glowing half-ellipse.
This commit is contained in:
Samuel Mannehed
2017-05-22 08:24:41 +02:00
parent c23665dd82
commit bbc1648c7a
3 changed files with 43 additions and 0 deletions
+12
View File
@@ -627,6 +627,15 @@ const UI = {
UI.controlbarDrag = true;
},
showControlbarHint: function (show) {
var hint = document.getElementById('noVNC_control_bar_hint');
if (show) {
hint.classList.add("noVNC_active");
} else {
hint.classList.remove("noVNC_active");
}
},
dragControlbarHandle: function (e) {
if (!UI.controlbarGrabbed) return;
@@ -722,6 +731,7 @@ const UI = {
UI.activateControlbar();
}
UI.controlbarGrabbed = false;
UI.showControlbarHint(false);
},
controlbarHandleMouseDown: function(e) {
@@ -740,6 +750,8 @@ const UI = {
UI.controlbarGrabbed = true;
UI.controlbarDrag = false;
UI.showControlbarHint(true);
UI.controlbarMouseDownClientY = ptr.clientY;
UI.controlbarMouseDownOffsetY = ptr.clientY - bounds.top;
e.preventDefault();