List of loaded pdf

This commit is contained in:
Vincent LAURENT 2022-04-28 19:13:45 +02:00
parent abb63e8f90
commit 36a692e34b
1 changed files with 9 additions and 0 deletions

View File

@ -23,6 +23,7 @@ var loadPDF = async function(pdfBlob, filename, pdfIndex) {
type: 'application/pdf'
}));
document.getElementById('input_pdf').files = dataTransfer.files;
updateListePDF();
let pdfLetter = String.fromCharCode(96 + i+1).toUpperCase();
@ -152,6 +153,14 @@ var stateCheckboxAll = function() {
document.querySelector('#checkbox_all_pages').checked = (document.querySelectorAll('.checkbox-page:checked').length == document.querySelectorAll('.checkbox-page').length);
};
var updateListePDF = function() {
document.querySelector('#list_pdf').innerHTML = "";
for (var i = 0; i < document.querySelector('#input_pdf').files.length; i++) {
const pdfFile = document.querySelector('#input_pdf').files.item(i);
document.querySelector('#list_pdf').insertAdjacentHTML('beforeend', '<li class="list-group-item small" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;"><i class="bi bi-files"></i> '+decodeURI(pdfFile.name)+'</li>');
}
}
var createEventsListener = function() {
document.querySelector('#checkbox_all_pages').addEventListener('change', function() {
let checkboxAll = this;