diff options
author | samhed <samuel@cendio.se> | 2016-04-25 16:38:23 +0200 |
---|---|---|
committer | samhed <samuel@cendio.se> | 2016-04-25 16:38:23 +0200 |
commit | f620259bc59dc18e91653918cdb513626a3af8dd (patch) | |
tree | a8fc12c224858b101f18ace4d33bdfbbe3c800e2 | |
parent | 529c64e1036b622ff971b1a0cd13856837d3a9eb (diff) | |
download | novnc-f620259bc59dc18e91653918cdb513626a3af8dd.tar.gz |
Force clipping mode in Safari on all platforms
-rw-r--r-- | include/ui.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/ui.js b/include/ui.js index 425e5a3..cfdedb3 100644 --- a/include/ui.js +++ b/include/ui.js @@ -35,6 +35,7 @@ var UI; keyboardVisible: false, isTouchDevice: false, + isSafari: false, rememberedClipSetting: null, lastKeyboardinput: null, defaultKeyboardinputLen: 100, @@ -137,12 +138,12 @@ var UI; UI.setBarPosition(); } ); - var isSafari = (navigator.userAgent.indexOf('Safari') != -1 && - navigator.userAgent.indexOf('Chrome') == -1); + UI.isSafari = (navigator.userAgent.indexOf('Safari') != -1 && + navigator.userAgent.indexOf('Chrome') == -1); // Only show the button if fullscreen is properly supported // * Safari doesn't support alphanumerical input while in fullscreen - if (!isSafari && + if (!UI.isSafari && (document.documentElement.requestFullscreen || document.documentElement.mozRequestFullScreen || document.documentElement.webkitRequestFullscreen || @@ -942,7 +943,12 @@ var UI; var resizeElem = $D('noVNC_resize'); var connected = UI.rfb && UI.rfb_state === 'normal'; - if (resizeElem.value === 'downscale' || resizeElem.value === 'scale') { + if (UI.isSafari) { + // Safari auto-hides the scrollbars which makes them + // impossible to use in most cases + UI.setViewClip(true); + $D('noVNC_clip').disabled = true; + } else if (resizeElem.value === 'downscale' || resizeElem.value === 'scale') { // Disable clipping if we are scaling UI.setViewClip(false); $D('noVNC_clip').disabled = true; |