Skip to content

Commit

Permalink
Allow scroll bars on Safari and IE
Browse files Browse the repository at this point in the history
The previous problems were because we were scrolling the wrong element,
so we can enable this feature now.
  • Loading branch information
samhed committed Feb 16, 2017
1 parent f3b7727 commit b18ef81
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions app/ui.js
Expand Up @@ -1315,34 +1315,11 @@ var UI;
enableDisableViewClip: function() {
var resizeSetting = UI.getSetting('resize');

if (UI.isSafari) {
// Safari auto-hides the scrollbars which makes them
// impossible to use in most cases
UI.setViewClip(true);
document.getElementById('noVNC_setting_clip').disabled = true;
} else if (resizeSetting === 'downscale' || resizeSetting === 'scale') {
if (resizeSetting === 'downscale' || resizeSetting === 'scale') {
// Disable clipping if we are scaling
UI.forceSetting('clip', false);
UI.setViewClip(false);
document.getElementById('noVNC_setting_clip').disabled = true;
} else if (document.msFullscreenElement) {
// The browser is IE and we are in fullscreen mode.
// - We need to force clipping while in fullscreen since
// scrollbars doesn't work.
var msg = _("Forcing clipping mode since " +
"scrollbars aren't supported " +
"by IE in fullscreen");
Util.Debug(msg);
UI.showStatus(msg);
UI.rememberedClipSetting = UI.getSetting('clip');
UI.setViewClip(true);
document.getElementById('noVNC_setting_clip').disabled = true;
} else if (document.body.msRequestFullscreen &&
UI.rememberedClipSetting !== null) {
// Restore view clip to what it was before fullscreen on IE
UI.setViewClip(UI.rememberedClipSetting);
document.getElementById('noVNC_setting_clip').disabled =
UI.connected || Util.isTouchDevice;
} else {
document.getElementById('noVNC_setting_clip').disabled =
UI.connected || Util.isTouchDevice;
Expand Down

0 comments on commit b18ef81

Please sign in to comment.