From a192cbfa27f15c2c8506b83b82b2704ffeb8a9fc Mon Sep 17 00:00:00 2001 From: Eddy Date: Fri, 17 Apr 2026 12:50:51 +0200 Subject: [PATCH] Fix: PDFs + Dokumente direkt zum Download (kein problematischer iframe) [deploy] --- app.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index b86962e..424f68e 100644 --- a/app.js +++ b/app.js @@ -1793,11 +1793,10 @@ function formatShortDate(ts) { } function openFileViewer({ url, blob, mime }, filename) { - const isPdf = (mime || '').includes('pdf') || /\.pdf$/i.test(filename); const isImage = (mime || '').startsWith('image/'); - if (!isPdf && !isImage) { - // Nicht inline anzeigbar → Download anstoßen + if (!isImage) { + // Alles außer Bildern: direkt Download const a = document.createElement('a'); a.href = url; a.download = filename || 'download'; @@ -1805,6 +1804,7 @@ function openFileViewer({ url, blob, mime }, filename) { a.click(); a.remove(); setTimeout(() => URL.revokeObjectURL(url), 10000); + showToast('⬇ ' + escapeHtml(filename || 'Datei') + ' wird heruntergeladen'); return; } @@ -1814,12 +1814,9 @@ function openFileViewer({ url, blob, mime }, filename) {
${escapeHtml(filename || '')}
-
- ${isPdf - ? `` - : ``} +
`; document.body.appendChild(modal);