From 9b21f17b032464a839ca59a35c27d1d75888d60b Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 21 Sep 2023 20:08:08 +0200 Subject: [PATCH] Prevent wheel/touch zooming in the viewer when a dialog is open --- web/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/app.js b/web/app.js index d7261fed1..c41eda6ce 100644 --- a/web/app.js +++ b/web/app.js @@ -2736,7 +2736,11 @@ function webViewerWheel(evt) { // Only zoom the pages, not the entire viewer. evt.preventDefault(); // NOTE: this check must be placed *after* preventDefault. - if (zoomDisabledTimeout || document.visibilityState === "hidden") { + if ( + zoomDisabledTimeout || + document.visibilityState === "hidden" || + PDFViewerApplication.overlayManager.active + ) { return; } @@ -2812,7 +2816,7 @@ function webViewerTouchStart(evt) { } evt.preventDefault(); - if (evt.touches.length !== 2) { + if (evt.touches.length !== 2 || PDFViewerApplication.overlayManager.active) { PDFViewerApplication._touchInfo = null; return; }