Fixed an error in checkBoxes function and uploadContainer "drop" listener regarding file path testing

This commit is contained in:
2025-11-12 18:52:28 +01:00
parent 0f54edb0aa
commit c8cbd4e92a
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -1,7 +1,5 @@
const dropzone = document.getElementById("uploadContainer");
dropzone.addEventListener("dragover", (e) =>{
uploadContainer.addEventListener("dragover", (e) =>{
try {
e.stopPropagation();
e.preventDefault();
@@ -12,14 +10,14 @@ dropzone.addEventListener("dragover", (e) =>{
});
//listener for when a file get dropped on the drag&drop field
dropzone.addEventListener("drop", (e) => {
uploadContainer.addEventListener("drop", (e) => {
try {
e.stopPropagation()
e.preventDefault()
const files = e.dataTransfer.files
const filePath = window.explorer.onFileDrop(files[0])
var holdy = filePath + "";
if(holdy.endsWith(".mp4", ".mov", ".avi", ".mkv")){
if(holdy.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
console.log(filePath)
const files1 = e.dataTransfer.files;