Commit 30bfff81 authored by samhed's avatar samhed

Clarified enableDisableClip (now called enableDisableViewClip) and

moved it to where the other clipping functions are.
parent 4f19e5c6
...@@ -220,7 +220,7 @@ var UI; ...@@ -220,7 +220,7 @@ var UI;
$D("noVNC_resize").onchange = function () { $D("noVNC_resize").onchange = function () {
var connected = UI.rfb && UI.rfb_state === 'normal'; var connected = UI.rfb && UI.rfb_state === 'normal';
UI.enableDisableClip(connected); UI.enableDisableViewClip(connected);
}; };
}, },
...@@ -685,7 +685,7 @@ var UI; ...@@ -685,7 +685,7 @@ var UI;
$D('noVNC_cursor').disabled = true; $D('noVNC_cursor').disabled = true;
} }
UI.enableDisableClip(connected); UI.enableDisableViewClip(connected);
$D('noVNC_resize').disabled = connected; $D('noVNC_resize').disabled = connected;
$D('noVNC_shared').disabled = connected; $D('noVNC_shared').disabled = connected;
$D('noVNC_view_only').disabled = connected; $D('noVNC_view_only').disabled = connected;
...@@ -747,19 +747,6 @@ var UI; ...@@ -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 // This resize can not be done until we know from the first Frame Buffer Update
// if it is supported or not. // if it is supported or not.
// The resize is needed to make sure the server desktop size is updated to the // The resize is needed to make sure the server desktop size is updated to the
...@@ -849,7 +836,7 @@ var UI; ...@@ -849,7 +836,7 @@ var UI;
Util.Debug("<< UI.clipSend"); Util.Debug("<< UI.clipSend");
}, },
// Enable/disable and configure viewport clipping // Set and configure viewport clipping
setViewClip: function(clip) { setViewClip: function(clip) {
var display; var display;
if (UI.rfb) { if (UI.rfb) {
...@@ -900,6 +887,20 @@ var UI; ...@@ -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 // Update the viewport drag/move button
updateViewDrag: function(drag) { updateViewDrag: function(drag) {
if (!UI.rfb) return; if (!UI.rfb) return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment