Move filename input logic to its own function
This commit is contained in:
parent
e43e6d18b9
commit
18d289d3b7
1 changed files with 24 additions and 21 deletions
|
@ -74,6 +74,16 @@ class PdfContainer {
|
||||||
input.onchange = async(e) => {
|
input.onchange = async(e) => {
|
||||||
const files = e.target.files;
|
const files = e.target.files;
|
||||||
if (files.length > 0) {
|
if (files.length > 0) {
|
||||||
|
updateFilenameInput()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addPdfsFromFiles(files, nextSiblingElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
input.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
updateFilenameInput() {
|
||||||
const filenameInput = document.getElementById('filename-input');
|
const filenameInput = document.getElementById('filename-input');
|
||||||
const pagesContainer = document.getElementById('pages-container');
|
const pagesContainer = document.getElementById('pages-container');
|
||||||
const downloadBtn = document.getElementById('export-button');
|
const downloadBtn = document.getElementById('export-button');
|
||||||
|
@ -93,13 +103,6 @@ class PdfContainer {
|
||||||
} else {
|
} else {
|
||||||
filenameInput.value = this.filename;
|
filenameInput.value = this.filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addPdfsFromFiles(files, nextSiblingElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
input.click();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async addPdfsFromFiles(files, nextSiblingElement) {
|
async addPdfsFromFiles(files, nextSiblingElement) {
|
||||||
|
|
Loading…
Reference in a new issue