1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-11-16 12:20:12 +01:00

Merge branch 'main' of git@github.com:Frooodle/Stirling-PDF.git into

main
This commit is contained in:
Anthony Stirling 2023-08-06 21:56:47 +01:00
commit c047c46587

View File

@ -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("<div>" + fileName + "</div>");
});
if (fileNames.length === 1) {
$(inputElement).siblings(".custom-file-label").addClass("selected").html(fileNames[0]);
} else if (fileNames.length > 1) {