Skip to content

Commit

Permalink
Merge pull request #18423 from Snuffleupagus/rm-setZoomDisabledTimeout
Browse files Browse the repository at this point in the history
Remove the remaining `zoomDisabledTimeout` usage (issue 17727)
  • Loading branch information
Snuffleupagus authored Jul 11, 2024
2 parents 8082c2d + 6b47ddd commit acc70ce
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ import { Toolbar } from "web-toolbar";
import { ViewHistory } from "./view_history.js";

const FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms
const WHEEL_ZOOM_DISABLED_TIMEOUT = 1000; // ms

const ViewOnLoad = {
UNKNOWN: -1,
Expand Down Expand Up @@ -1996,9 +1995,6 @@ const PDFViewerApplication = {
}
addWindowResolutionChange();

window.addEventListener("visibilitychange", webViewerVisibilityChange, {
signal,
});
window.addEventListener("wheel", webViewerWheel, {
passive: false,
signal,
Expand Down Expand Up @@ -2585,23 +2581,6 @@ function webViewerResolutionChange(evt) {
PDFViewerApplication.pdfViewer.refresh();
}

function webViewerVisibilityChange(evt) {
if (document.visibilityState === "visible") {
// Ignore mouse wheel zooming during tab switches (bug 1503412).
setZoomDisabledTimeout();
}
}

let zoomDisabledTimeout = null;
function setZoomDisabledTimeout() {
if (zoomDisabledTimeout) {
clearTimeout(zoomDisabledTimeout);
}
zoomDisabledTimeout = setTimeout(function () {
zoomDisabledTimeout = null;
}, WHEEL_ZOOM_DISABLED_TIMEOUT);
}

function webViewerWheel(evt) {
const {
pdfViewer,
Expand Down Expand Up @@ -2654,7 +2633,6 @@ function webViewerWheel(evt) {
// NOTE: this check must be placed *after* preventDefault.
if (
PDFViewerApplication._isScrolling ||
zoomDisabledTimeout ||
document.visibilityState === "hidden" ||
PDFViewerApplication.overlayManager.active
) {
Expand Down

0 comments on commit acc70ce

Please sign in to comment.