Compare commits
4 Commits
6f9b386c18
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 77e506ea4c | |||
| 810b020d7d | |||
| 5be89f83fd | |||
| 2a7783004a |
@@ -42,6 +42,7 @@
|
||||
let formErrors: Record<string, any> | null = $state(null);
|
||||
let etag: string | null = $state(null);
|
||||
let files: FileList | null = $state(null);
|
||||
let fileInput = $state(null);
|
||||
|
||||
// Model Variablen für Upload
|
||||
let openUL = $state(false);
|
||||
@@ -102,6 +103,7 @@
|
||||
openUL = false;
|
||||
name = '';
|
||||
files = null;
|
||||
fileInput.value = "";
|
||||
await invalidateAll();
|
||||
crimesList = data.crimesList;
|
||||
}
|
||||
@@ -291,13 +293,21 @@ Mit freundlichen Grüßen,
|
||||
// drag and drop functionality
|
||||
let isDragging = $state(false);
|
||||
|
||||
function handleDrop(event) {
|
||||
async function handleDrop(event) {
|
||||
event.preventDefault();
|
||||
isDragging = false;
|
||||
|
||||
if (event.dataTransfer?.files?.length) {
|
||||
files = event.dataTransfer.files;
|
||||
}
|
||||
if (!(await check_valid_glb_file())) {
|
||||
formErrors = { file: 'Keine gültige .GLD-Datei' }
|
||||
// reset form fields etc.
|
||||
files = null;
|
||||
fileInput.value = '';
|
||||
} else {
|
||||
formErrors = { ...formErrors, file: ''}
|
||||
};
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -449,7 +459,7 @@ Mit freundlichen Grüßen,
|
||||
class="relative cursor-pointer rounded-md bg-white font-semibold text-indigo-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-indigo-600 focus-within:ring-offset-2 hover:text-indigo-500"
|
||||
>
|
||||
<span>Wähle eine Datei aus</span>
|
||||
<input id="file" bind:files name="file" type="file" class="sr-only" />
|
||||
<input id="file" bind:this={fileInput} bind:files name="file" type="file" class="sr-only" />
|
||||
</label>
|
||||
<p class="pl-1">oder ziehe sie ins Feld</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user