Skip to content

Commit

Permalink
Merge pull request #11003 from Snuffleupagus/webViewerWheel-supported…
Browse files Browse the repository at this point in the history
…Keys

Ensure that setting the `zoomDisabledTimeout` isn't skipped, regardless of the supported zoom keys, when handling mouse wheel events (PR 7097 follow-up)
  • Loading branch information
timvandermeij authored Jul 23, 2019
2 parents e066db4 + 1eed5b7 commit 9b72089
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2097,17 +2097,15 @@ function setZoomDisabledTimeout() {
}

function webViewerWheel(evt) {
let pdfViewer = PDFViewerApplication.pdfViewer;
const { pdfViewer, supportedMouseWheelZoomModifierKeys, } =
PDFViewerApplication;

if (pdfViewer.isInPresentationMode) {
return;
}

if (evt.ctrlKey || evt.metaKey) {
let support = PDFViewerApplication.supportedMouseWheelZoomModifierKeys;
if ((evt.ctrlKey && !support.ctrlKey) ||
(evt.metaKey && !support.metaKey)) {
return;
}
if ((evt.ctrlKey && supportedMouseWheelZoomModifierKeys.ctrlKey) ||
(evt.metaKey && supportedMouseWheelZoomModifierKeys.metaKey)) {
// Only zoom the pages, not the entire viewer.
evt.preventDefault();
// NOTE: this check must be placed *after* preventDefault.
Expand Down

0 comments on commit 9b72089

Please sign in to comment.