Compare commits
3 Commits
6f9b386c18
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
| 810b020d7d | |||
| 5be89f83fd | |||
| 2a7783004a |
@@ -42,6 +42,7 @@
|
|||||||
let formErrors: Record<string, any> | null = $state(null);
|
let formErrors: Record<string, any> | null = $state(null);
|
||||||
let etag: string | null = $state(null);
|
let etag: string | null = $state(null);
|
||||||
let files: FileList | null = $state(null);
|
let files: FileList | null = $state(null);
|
||||||
|
let fileInput = $state(null);
|
||||||
|
|
||||||
// Model Variablen für Upload
|
// Model Variablen für Upload
|
||||||
let openUL = $state(false);
|
let openUL = $state(false);
|
||||||
@@ -102,6 +103,7 @@
|
|||||||
openUL = false;
|
openUL = false;
|
||||||
name = '';
|
name = '';
|
||||||
files = null;
|
files = null;
|
||||||
|
fileInput.value = "";
|
||||||
await invalidateAll();
|
await invalidateAll();
|
||||||
crimesList = data.crimesList;
|
crimesList = data.crimesList;
|
||||||
}
|
}
|
||||||
@@ -291,13 +293,21 @@ Mit freundlichen Grüßen,
|
|||||||
// drag and drop functionality
|
// drag and drop functionality
|
||||||
let isDragging = $state(false);
|
let isDragging = $state(false);
|
||||||
|
|
||||||
function handleDrop(event) {
|
async function handleDrop(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
isDragging = false;
|
isDragging = false;
|
||||||
|
|
||||||
if (event.dataTransfer?.files?.length) {
|
if (event.dataTransfer?.files?.length) {
|
||||||
files = event.dataTransfer.files;
|
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>
|
</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"
|
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>
|
<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>
|
</label>
|
||||||
<p class="pl-1">oder ziehe sie ins Feld</p>
|
<p class="pl-1">oder ziehe sie ins Feld</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user