Clear file inputs after jobs (#2248)

This commit is contained in:
Rafael Encinas
2024-11-15 13:21:23 -07:00
committed by GitHub
parent fd93dad9a5
commit 1833d7cd73
7 changed files with 66 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ class PdfContainer {
this.toggleSelectPageVisibility = this.toggleSelectPageVisibility.bind(this);
this.updatePagesFromCSV = this.updatePagesFromCSV.bind(this);
this.addFilesBlankAll = this.addFilesBlankAll.bind(this)
this.removeAllElements = this.removeAllElements.bind(this);
this.pdfAdapters = pdfAdapters;
@@ -53,6 +54,7 @@ class PdfContainer {
window.updateSelectedPagesDisplay = this.updateSelectedPagesDisplay;
window.updatePageNumbersAndCheckboxes = this.updatePageNumbersAndCheckboxes;
window.addFilesBlankAll = this.addFilesBlankAll
window.removeAllElements = this.removeAllElements;
const filenameInput = document.getElementById("filename-input");
const downloadBtn = document.getElementById("export-button");
@@ -294,6 +296,16 @@ class PdfContainer {
}
}
removeAllElements(){
let pageContainerNodeList = document.querySelectorAll(".page-container");
for (var i = 0; i < pageContainerNodeList.length; i++) {
pageContainerNodeList[i].remove();
}
document.querySelectorAll(".enable-on-file").forEach((element) => {
element.disabled = true;
});
}
deleteSelected() {
window.selectedPages.sort((a, b) => a - b);
let deletions = 0;