mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-09 04:51:09 +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">
|
<script lang="ts">
|
||||||
import FileType from './FileType.svelte';
|
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 { submissionProgress, UploadStatus, type Status } from '$lib/stores/portfolio';
|
||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
import ProgressBar from './ProgressBar.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>
|
</script>
|
||||||
|
|
||||||
<div class="card uploadCard relative">
|
<div class="card uploadCard relative">
|
||||||
|
|
@ -144,15 +151,11 @@
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<FileDrop
|
<div
|
||||||
multiple={false}
|
use:filedrop={FileDropOptions}
|
||||||
maxSize={filesize * 1_000_000}
|
|
||||||
accept={filetype == 'PDF' ? 'application/pdf' : 'application/zip'}
|
|
||||||
on:filedrop={(e) => onFileDrop(e.detail.files)}
|
on:filedrop={(e) => onFileDrop(e.detail.files)}
|
||||||
on:filedragenter={dashAnimationStart}
|
on:filedragenter={dashAnimationStart}
|
||||||
on:filedragleave={dashAnimationStop}
|
on:filedragleave={dashAnimationStop}
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="drag group"
|
class="drag group"
|
||||||
on:mouseenter={dashAnimationStart}
|
on:mouseenter={dashAnimationStart}
|
||||||
on:mouseleave={dashAnimationStop}
|
on:mouseleave={dashAnimationStop}
|
||||||
|
|
@ -161,7 +164,6 @@
|
||||||
<span class="text-[#406280]">Sem přetáhněte,</span>
|
<span class="text-[#406280]">Sem přetáhněte,</span>
|
||||||
<span class="text-sspsGray">nebo nahrajte {placeholder}</span>
|
<span class="text-sspsGray">nebo nahrajte {placeholder}</span>
|
||||||
</div>
|
</div>
|
||||||
</FileDrop>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue