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:
commit
c047c46587
@ -80,14 +80,11 @@ function setupFileInput(chooser) {
|
|||||||
document.body.addEventListener('dragleave', dragleaveListener);
|
document.body.addEventListener('dragleave', dragleaveListener);
|
||||||
document.body.addEventListener('drop', dropListener);
|
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);
|
allFiles = Array.from(e.target.files);
|
||||||
handleFileInputChange(this);
|
handleFileInputChange(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function handleFileInputChange(inputElement) {
|
function handleFileInputChange(inputElement) {
|
||||||
const files = allFiles;
|
const files = allFiles;
|
||||||
const fileNames = files.map(f => f.name);
|
const fileNames = files.map(f => f.name);
|
||||||
@ -96,7 +93,6 @@ function setupFileInput(chooser) {
|
|||||||
fileNames.forEach(fileName => {
|
fileNames.forEach(fileName => {
|
||||||
selectedFilesContainer.append("<div>" + fileName + "</div>");
|
selectedFilesContainer.append("<div>" + fileName + "</div>");
|
||||||
});
|
});
|
||||||
|
|
||||||
if (fileNames.length === 1) {
|
if (fileNames.length === 1) {
|
||||||
$(inputElement).siblings(".custom-file-label").addClass("selected").html(fileNames[0]);
|
$(inputElement).siblings(".custom-file-label").addClass("selected").html(fileNames[0]);
|
||||||
} else if (fileNames.length > 1) {
|
} else if (fileNames.length > 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user