diff --git a/src/main/resources/static/js/fileInput.js b/src/main/resources/static/js/fileInput.js index b544304a..7825af8b 100644 --- a/src/main/resources/static/js/fileInput.js +++ b/src/main/resources/static/js/fileInput.js @@ -80,14 +80,11 @@ function setupFileInput(chooser) { document.body.addEventListener('dragleave', dragleaveListener); document.body.addEventListener('drop', dropListener); - console.log("Element Id: ", elementId); - - $("#" + elementId).on("change", function(e) { + $("#" + elementId).on("change", function(e) { allFiles = Array.from(e.target.files); handleFileInputChange(this); }); - function handleFileInputChange(inputElement) { const files = allFiles; const fileNames = files.map(f => f.name); @@ -96,7 +93,6 @@ function setupFileInput(chooser) { fileNames.forEach(fileName => { selectedFilesContainer.append("
" + fileName + "
"); }); - if (fileNames.length === 1) { $(inputElement).siblings(".custom-file-label").addClass("selected").html(fileNames[0]); } else if (fileNames.length > 1) {