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:
parent
22babd722f
commit
e1760aab8d
10 changed files with 32 additions and 31 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue