add .GLD file verification for drag and drop
This commit is contained in:
@@ -293,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>
|
||||||
|
|||||||
Reference in New Issue
Block a user