1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Use the stopEvent helper function everywhere possible

This commit is contained in:
Jonas Jenwald 2024-11-28 13:25:56 +01:00
parent 22babd722f
commit e1760aab8d
10 changed files with 32 additions and 31 deletions

View file

@ -53,6 +53,7 @@ import {
MissingPDFException,
PDFWorker,
shadow,
stopEvent,
UnexpectedResponseException,
version,
} from "pdfjs-lib";
@ -715,8 +716,7 @@ const PDFViewerApplication = {
if (item.type === "application/pdf") {
evt.dataTransfer.dropEffect =
evt.dataTransfer.effectAllowed === "copy" ? "copy" : "move";
evt.preventDefault();
evt.stopPropagation();
stopEvent(evt);
return;
}
}
@ -725,8 +725,7 @@ const PDFViewerApplication = {
if (evt.dataTransfer.files?.[0].type !== "application/pdf") {
return;
}
evt.preventDefault();
evt.stopPropagation();
stopEvent(evt);
eventBus.dispatch("fileinputchange", {
source: this,
fileInput: evt.dataTransfer,