Fix: PDF-Download-Button zeigt kein Dialog, nur Download [deploy]
All checks were successful
Deploy baustelle-pwa / deploy (push) Successful in 5s
All checks were successful
Deploy baustelle-pwa / deploy (push) Successful in 5s
This commit is contained in:
parent
125a6302ab
commit
0294509ee5
1 changed files with 7 additions and 1 deletions
8
app.js
8
app.js
|
|
@ -1843,7 +1843,7 @@ async function openPdfViewer(blob, filename, blobUrl) {
|
|||
<button class="icon-btn" id="pdf-next" title="Seite vor →">›</button>
|
||||
<div class="fs-title">${escapeHtml(filename || '')}</div>
|
||||
<button class="icon-btn" id="pdf-close">✕</button>
|
||||
<a class="icon-btn" id="pdf-download" title="Download" download="${escapeHtml(filename || 'download')}" href="${blobUrl}">⬇</a>
|
||||
<button class="icon-btn" id="pdf-download" title="Download">⬇</button>
|
||||
</div>
|
||||
<div class="pdf-body" id="pdf-body">
|
||||
<canvas id="pdf-canvas"></canvas>
|
||||
|
|
@ -1874,6 +1874,12 @@ async function openPdfViewer(blob, filename, blobUrl) {
|
|||
await renderPage(1);
|
||||
modal.querySelector('#pdf-prev').onclick = () => renderPage(currentPage - 1);
|
||||
modal.querySelector('#pdf-next').onclick = () => renderPage(currentPage + 1);
|
||||
modal.querySelector('#pdf-download').onclick = () => {
|
||||
const a = document.createElement('a');
|
||||
a.href = blobUrl;
|
||||
a.download = filename || 'download.pdf';
|
||||
a.click();
|
||||
};
|
||||
modal.querySelector('#pdf-prev').disabled = false;
|
||||
modal.querySelector('#pdf-next').disabled = pdf.numPages === 1;
|
||||
} catch (err) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue