drop file to load

This commit is contained in:
vcoppe
2024-06-11 19:27:10 +02:00
parent d8df3204d9
commit c72b817e8f

View File

@@ -33,7 +33,8 @@
exportAllFiles, exportAllFiles,
exportSelectedFiles, exportSelectedFiles,
triggerFileInput, triggerFileInput,
createFile createFile,
loadFiles
} from '$lib/stores'; } from '$lib/stores';
import { selectAll, selection } from '$lib/components/file-list/Selection'; import { selectAll, selection } from '$lib/components/file-list/Selection';
import { derived } from 'svelte/store'; import { derived } from 'svelte/store';
@@ -340,6 +341,13 @@
e.preventDefault(); e.preventDefault();
} }
}} }}
on:dragover={(e) => e.preventDefault()}
on:drop={(e) => {
e.preventDefault();
if (e.dataTransfer.files.length > 0) {
loadFiles(e.dataTransfer.files);
}
}}
/> />
<style lang="postcss"> <style lang="postcss">