mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-10 21:40:56 +00:00
fix: critical fix, disable window file drop
This commit is contained in:
parent
1ec14e5f77
commit
87c04c8602
1 changed files with 18 additions and 16 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<script lang="ts">
|
||||
import FileType from './FileType.svelte';
|
||||
import FileDrop from 'filedrop-svelte';
|
||||
import { filedrop, type FileDropOptions } from 'filedrop-svelte';
|
||||
import { submissionProgress, UploadStatus, type Status } from '$lib/stores/portfolio';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import ProgressBar from './ProgressBar.svelte';
|
||||
|
|
@ -86,6 +86,13 @@
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
const FileDropOptions: FileDropOptions = {
|
||||
accept: filetype === 'PDF' ? 'application/pdf' : 'application/zip',
|
||||
maxSize: filesize * 1_000_000,
|
||||
multiple: false,
|
||||
windowDrop: false
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class="card uploadCard relative">
|
||||
|
|
@ -144,15 +151,11 @@
|
|||
</div>
|
||||
{:else}
|
||||
<div class="body">
|
||||
<FileDrop
|
||||
multiple={false}
|
||||
maxSize={filesize * 1_000_000}
|
||||
accept={filetype == 'PDF' ? 'application/pdf' : 'application/zip'}
|
||||
<div
|
||||
use:filedrop={FileDropOptions}
|
||||
on:filedrop={(e) => onFileDrop(e.detail.files)}
|
||||
on:filedragenter={dashAnimationStart}
|
||||
on:filedragleave={dashAnimationStop}
|
||||
>
|
||||
<div
|
||||
class="drag group"
|
||||
on:mouseenter={dashAnimationStart}
|
||||
on:mouseleave={dashAnimationStop}
|
||||
|
|
@ -161,7 +164,6 @@
|
|||
<span class="text-[#406280]">Sem přetáhněte,</span>
|
||||
<span class="text-sspsGray">nebo nahrajte {placeholder}</span>
|
||||
</div>
|
||||
</FileDrop>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue