mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #11003 from Snuffleupagus/webViewerWheel-supportedKeys
Ensure that setting the `zoomDisabledTimeout` isn't skipped, regardless of the supported zoom keys, when handling mouse wheel events (PR 7097 follow-up)
This commit is contained in:
commit
9b72089886
1 changed files with 5 additions and 7 deletions
12
web/app.js
12
web/app.js
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue