feat: only load pdfjs when its used

This commit is contained in:
sbplat
2024-09-14 21:02:10 -04:00
parent 7e2a53a02e
commit 7fb605baa1
11 changed files with 12 additions and 5 deletions

View File

@@ -21,6 +21,7 @@
<!-- pdf selector -->
<div th:replace="~{fragments/common :: fileSelector(name='pdf-upload', multipleInputsForSingleRequest=false, accept='application/pdf')}"></div>
<script type="module" th:src="@{'/pdfjs-legacy/pdf.mjs'}"></script>
<script>
let originalFileName = '';
document.querySelector('input[name=pdf-upload]').addEventListener('change', async (event) => {