mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Remove the remaining zoomDisabledTimeout
usage (issue 17727)
With https://bugzilla.mozilla.org/show_bug.cgi?id=1882168 now marked as fixed by the landing of https://bugzilla.mozilla.org/show_bug.cgi?id=1902017 we should *hopefully* be able to remove this work-around.
This commit is contained in:
parent
9b1b5ff7e7
commit
6b47ddd4d5
1 changed files with 0 additions and 22 deletions
22
web/app.js
22
web/app.js
|
@ -87,7 +87,6 @@ import { Toolbar } from "web-toolbar";
|
||||||
import { ViewHistory } from "./view_history.js";
|
import { ViewHistory } from "./view_history.js";
|
||||||
|
|
||||||
const FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms
|
const FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms
|
||||||
const WHEEL_ZOOM_DISABLED_TIMEOUT = 1000; // ms
|
|
||||||
|
|
||||||
const ViewOnLoad = {
|
const ViewOnLoad = {
|
||||||
UNKNOWN: -1,
|
UNKNOWN: -1,
|
||||||
|
@ -1996,9 +1995,6 @@ const PDFViewerApplication = {
|
||||||
}
|
}
|
||||||
addWindowResolutionChange();
|
addWindowResolutionChange();
|
||||||
|
|
||||||
window.addEventListener("visibilitychange", webViewerVisibilityChange, {
|
|
||||||
signal,
|
|
||||||
});
|
|
||||||
window.addEventListener("wheel", webViewerWheel, {
|
window.addEventListener("wheel", webViewerWheel, {
|
||||||
passive: false,
|
passive: false,
|
||||||
signal,
|
signal,
|
||||||
|
@ -2585,23 +2581,6 @@ function webViewerResolutionChange(evt) {
|
||||||
PDFViewerApplication.pdfViewer.refresh();
|
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) {
|
function webViewerWheel(evt) {
|
||||||
const {
|
const {
|
||||||
pdfViewer,
|
pdfViewer,
|
||||||
|
@ -2654,7 +2633,6 @@ function webViewerWheel(evt) {
|
||||||
// NOTE: this check must be placed *after* preventDefault.
|
// NOTE: this check must be placed *after* preventDefault.
|
||||||
if (
|
if (
|
||||||
PDFViewerApplication._isScrolling ||
|
PDFViewerApplication._isScrolling ||
|
||||||
zoomDisabledTimeout ||
|
|
||||||
document.visibilityState === "hidden" ||
|
document.visibilityState === "hidden" ||
|
||||||
PDFViewerApplication.overlayManager.active
|
PDFViewerApplication.overlayManager.active
|
||||||
) {
|
) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue