development #48

Merged
titus merged 8 commits from development into main 2025-12-16 15:24:58 +01:00
Showing only changes of commit 810b020d7d - Show all commits

View File

@@ -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>