Skip to content

Commit

Permalink
🩹 Lazy load attachment pdf iframe
Browse files Browse the repository at this point in the history
This prevents smartphones where we don't show the iframe from loading the pdf (saving bandwidth) and fixes the file being downloaded on iphones in lockdown mode.
  • Loading branch information
pajowu committed Aug 7, 2023
1 parent b7fc1d9 commit 9461d84
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h2>{% blocktrans with name=attachment.name %}Attachment “{{ name }}”{% endb
{% if attachment.can_embed %}
{% if attachment.is_pdf %}
<div class="container-sm-full d-none d-md-block">
<iframe src="{{ attachment_url }}" frameborder="0" style="width: 100%; height: 90vh; border: 0;">
<iframe src="{{ attachment_url }}" frameborder="0" style="width: 100%; height: 90vh; border: 0;" loading="lazy">
</iframe>
</div>
<div class="container d-block d-md-none text-center">
Expand Down

0 comments on commit 9461d84

Please sign in to comment.