diff options
author | samhed <samuel@cendio.se> | 2015-06-25 15:29:23 +0200 |
---|---|---|
committer | samhed <samuel@cendio.se> | 2015-06-25 15:29:23 +0200 |
commit | 30bfff81d977da82b37c99a6aa77d7ecb9b7f773 (patch) | |
tree | 3e4a45b9f15ac000c88be1162a9df5bb89ce0b13 | |
parent | 4f19e5c697685f759771e2960d890a78cf5eae55 (diff) | |
download | novnc-30bfff81d977da82b37c99a6aa77d7ecb9b7f773.tar.gz |
Clarified enableDisableClip (now called enableDisableViewClip) and
moved it to where the other clipping functions are.
-rw-r--r-- | include/ui.js | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/include/ui.js b/include/ui.js index fe9c706..15fb15c 100644 --- a/include/ui.js +++ b/include/ui.js @@ -220,7 +220,7 @@ var UI; $D("noVNC_resize").onchange = function () { var connected = UI.rfb && UI.rfb_state === 'normal'; - UI.enableDisableClip(connected); + UI.enableDisableViewClip(connected); }; }, @@ -685,7 +685,7 @@ var UI; $D('noVNC_cursor').disabled = true; } - UI.enableDisableClip(connected); + UI.enableDisableViewClip(connected); $D('noVNC_resize').disabled = connected; $D('noVNC_shared').disabled = connected; $D('noVNC_view_only').disabled = connected; @@ -747,19 +747,6 @@ var UI; } }, - enableDisableClip: function (connected) { - var resizeElem = $D('noVNC_resize'); - if (resizeElem.value === 'downscale' || resizeElem.value === 'scale') { - UI.forceSetting('clip', false); - $D('noVNC_clip').disabled = true; - } else { - $D('noVNC_clip').disabled = connected || UI.isTouchDevice; - if (UI.isTouchDevice) { - UI.forceSetting('clip', true); - } - } - }, - // This resize can not be done until we know from the first Frame Buffer Update // if it is supported or not. // The resize is needed to make sure the server desktop size is updated to the @@ -849,7 +836,7 @@ var UI; Util.Debug("<< UI.clipSend"); }, - // Enable/disable and configure viewport clipping + // Set and configure viewport clipping setViewClip: function(clip) { var display; if (UI.rfb) { @@ -900,6 +887,20 @@ var UI; } }, + // Handle special cases where clipping is forced on/off or locked + enableDisableViewClip: function (connected) { + var resizeElem = $D('noVNC_resize'); + if (resizeElem.value === 'downscale' || resizeElem.value === 'scale') { + UI.forceSetting('clip', false); + $D('noVNC_clip').disabled = true; + } else { + $D('noVNC_clip').disabled = connected || UI.isTouchDevice; + if (UI.isTouchDevice) { + UI.forceSetting('clip', true); + } + } + }, + // Update the viewport drag/move button updateViewDrag: function(drag) { if (!UI.rfb) return; |