Skip to content

Commit

Permalink
Merge branch 'main' of [email protected]:Frooodle/Stirling-PDF.git into
Browse files Browse the repository at this point in the history
main
  • Loading branch information
Frooodle committed Aug 6, 2023
2 parents 54f53be + 8bb9e5b commit c047c46
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/main/resources/static/js/fileInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -96,7 +93,6 @@ function setupFileInput(chooser) {
fileNames.forEach(fileName => {
selectedFilesContainer.append("<div>" + fileName + "</div>");
});

if (fileNames.length === 1) {
$(inputElement).siblings(".custom-file-label").addClass("selected").html(fileNames[0]);
} else if (fileNames.length > 1) {
Expand Down

0 comments on commit c047c46

Please sign in to comment.