Use one noContextMenu function in both the src/- and web/-folders

Currently we duplicate this event handler function in multiple places, which seems unnecessary.
This commit is contained in:
Jonas Jenwald 2023-09-23 15:37:13 +02:00
parent a09b7228fb
commit 1df31c0284
7 changed files with 20 additions and 32 deletions

View file

@ -19,10 +19,9 @@ import {
DEFAULT_SCALE_VALUE,
MAX_SCALE,
MIN_SCALE,
noContextMenuHandler,
toggleCheckedBtn,
} from "./ui_utils.js";
import { AnnotationEditorType } from "pdfjs-lib";
import { AnnotationEditorType, noContextMenu } from "pdfjs-lib";
const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading";
@ -201,7 +200,7 @@ class Toolbar {
}
});
// Suppress context menus for some controls.
scaleSelect.oncontextmenu = noContextMenuHandler;
scaleSelect.oncontextmenu = noContextMenu;
this.eventBus._on("localized", () => {
this.#wasLocalized = true;