From 86309faf3cab87896527bcd217e320b6504b4289 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 7 Nov 2014 12:02:48 +0100 Subject: [PATCH 1/2] Prevent text selection in Presentation Mode (bug 1018882) --- web/viewer.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/viewer.css b/web/viewer.css index 856a0c881..4fbe0845b 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -55,6 +55,7 @@ select { height: 100%; overflow: hidden; cursor: none; + -webkit-user-select: none; } #viewerContainer:-moz-full-screen { @@ -65,6 +66,7 @@ select { height: 100%; overflow: hidden; cursor: none; + -moz-user-select: none; } #viewerContainer:-ms-fullscreen { @@ -74,6 +76,7 @@ select { height: 100%; overflow: hidden !important; cursor: none; + -ms-user-select: none; } #viewerContainer:-ms-fullscreen::-ms-backdrop { @@ -88,6 +91,9 @@ select { height: 100%; overflow: hidden; cursor: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; } :-webkit-full-screen a:not(.internalLink) { From ce62b9387d194a6f87ac884d1a96382ee32ca6cd Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 7 Nov 2014 12:43:51 +0100 Subject: [PATCH 2/2] Remove any active text selection when entering Presentation Mode --- web/presentation_mode.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/presentation_mode.js b/web/presentation_mode.js index 5d72e7c43..0c3253b34 100644 --- a/web/presentation_mode.js +++ b/web/presentation_mode.js @@ -150,6 +150,11 @@ var PresentationMode = { HandTool.enterPresentationMode(); this.contextMenuOpen = false; this.container.setAttribute('contextmenu', 'viewerContextMenu'); + + // Text selection is disabled in Presentation Mode, thus it's not possible + // for the user to deselect text that is selected (e.g. with "Select all") + // when entering Presentation Mode, hence we remove any active selection. + window.getSelection().removeAllRanges(); }, exit: function presentationModeExit() {