mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-05-13 17:55:56 +00:00
Add reset mechanism on fileInput
This commit is contained in:
parent
b11b6a700f
commit
c87b3c8c5d
@ -37,6 +37,7 @@ function setupFileInput(chooser) {
|
||||
const showUploads = chooser.getAttribute('data-bs-show-uploads') === "true";
|
||||
|
||||
let inputContainer = document.getElementById(inputContainerId);
|
||||
const input = document.getElementById(elementId);
|
||||
|
||||
if (inputContainer.id === 'pdf-upload-input-container') {
|
||||
inputContainer.querySelector('#dragAndDrop').innerHTML = window.fileInput.dragAndDropPDF;
|
||||
@ -47,6 +48,11 @@ function setupFileInput(chooser) {
|
||||
let overlay;
|
||||
let dragCounter = 0;
|
||||
|
||||
input.addEventListener('reset', (e) => {
|
||||
allFiles = [];
|
||||
input.value = null;
|
||||
});
|
||||
|
||||
inputContainer.addEventListener('click', (e) => {
|
||||
let inputBtn = document.getElementById(elementId);
|
||||
inputBtn.click();
|
||||
|
Loading…
x
Reference in New Issue
Block a user