mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
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:
parent
a09b7228fb
commit
1df31c0284
7 changed files with 20 additions and 32 deletions
|
@ -604,13 +604,6 @@ function getVisibleElements({
|
|||
return { first, last, views: visible, ids };
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler to suppress context menu.
|
||||
*/
|
||||
function noContextMenuHandler(evt) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
||||
function normalizeWheelEventDirection(evt) {
|
||||
let delta = Math.hypot(evt.deltaX, evt.deltaY);
|
||||
const angle = Math.atan2(evt.deltaY, evt.deltaX);
|
||||
|
@ -881,7 +874,6 @@ export {
|
|||
MAX_AUTO_SCALE,
|
||||
MAX_SCALE,
|
||||
MIN_SCALE,
|
||||
noContextMenuHandler,
|
||||
normalizeWheelEventDelta,
|
||||
normalizeWheelEventDirection,
|
||||
OutputScale,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue