mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 15:48:06 +02:00
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.)
This commit is contained in:
parent
f351eb23aa
commit
514210814d
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue