[Pkg-javascript-commits] [pdf.js] 348/414: Prevent the *entire* viewer from zooming, when quickly switching from scrolling to zooming using the mousewheel (PR 7097 followup)

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 514210814dbd9f1c9a0dac9305c8387bbfc153af
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Thu Apr 7 21:03:04 2016 +0200

    Prevent the *entire* viewer from zooming, when quickly switching from scrolling to zooming using the mousewheel (PR 7097 followup)
    
    This is a regression from PR 7097.
    
    (Also, out of scope for this PR, but I think that a `setTimeout` value of `1000 ms` is too large. Switching from scrolling to zooming can fell sluggish, and give the impression that nothing happens.)
---
 web/app.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/web/app.js b/web/app.js
index f79426e..532286e 100644
--- a/web/app.js
+++ b/web/app.js
@@ -1838,12 +1838,15 @@ function handleMouseWheel(evt) {
   } else if (evt.ctrlKey || evt.metaKey) {
     var support = PDFViewerApplication.supportedMouseWheelZoomModifierKeys;
     if ((evt.ctrlKey && !support.ctrlKey) ||
-        (evt.metaKey && !support.metaKey) ||
-        zoomDisabled) {
+        (evt.metaKey && !support.metaKey)) {
       return;
     }
     // Only zoom the pages, not the entire viewer.
     evt.preventDefault();
+    // NOTE: this check must be placed *after* preventDefault.
+    if (zoomDisabled) {
+      return;
+    }
 
     var previousScale = pdfViewer.currentScale;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list