v1.1.5
This commit is contained in:
1 parent
055edc7750
commit
7443ec059f
4 files changed
+13
-17
No files matched your search
@@ -75,12 +75,16 @@ export class AttachmentCleanPasteModule extends BaseModule {
|
||||
files: FileList,
|
||||
editor: Editor,
|
||||
settings: AttachmentCleanPasteSettings,
|
||||
evt: ClipboardEvent | DragEvent,
|
||||
): Promise<void> {
|
||||
const matchingFiles = Array.from(files).filter((f) =>
|
||||
this.shouldProcess(f.name, settings),
|
||||
);
|
||||
if (matchingFiles.length === 0) return;
|
||||
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
|
||||
const links: string[] = [];
|
||||
for (const file of matchingFiles) {
|
||||
const link = await this.processFile(file, settings);
|
||||
@@ -100,10 +104,7 @@ export class AttachmentCleanPasteModule extends BaseModule {
|
||||
const files = evt.clipboardData?.files;
|
||||
if (!files || files.length === 0) return;
|
||||
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
|
||||
await this.processAll(files, editor, settings);
|
||||
await this.processAll(files, editor, settings, evt);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -116,10 +117,7 @@ export class AttachmentCleanPasteModule extends BaseModule {
|
||||
const files = evt.dataTransfer?.files;
|
||||
if (!files || files.length === 0) return;
|
||||
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
|
||||
await this.processAll(files, editor, settings);
|
||||
await this.processAll(files, editor, settings, evt);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user