Merge branch '608-for-pdf-file-types-show-inline-don-t-download' into 'dev'

Resolve "for PDF file types, show inline, don't download"

See merge request keanuapp/keanuapp-weblite!311
This commit is contained in:
N Pex 2024-07-30 16:47:33 +00:00
commit 7125bad1f9

View file

@ -920,7 +920,10 @@ class Util {
const link = document.createElement("a");
link.href = url;
link.target = "_blank";
link.download = event.getContent().body || this.$t("fallbacks.download_name");
if (!this.isFileTypePDF(event)) {
// PDFs are shown inline, not downloaded
link.download = event.getContent().body || this.$t("fallbacks.download_name");
}
document.body.appendChild(link);
link.click();
setTimeout(function () {