diff options
author | Go MAEDA <maeda@farend.jp> | 2021-12-14 01:24:13 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-12-14 01:24:13 +0000 |
commit | e62358253646f7cc244db660890118e969c84de3 (patch) | |
tree | b53249d9fa50004d082995cf37b3b28b8fa26fe3 /app/helpers/application_helper.rb | |
parent | 9955844da1d209778f06ad9a3583949048b8ee88 (diff) | |
download | redmine-e62358253646f7cc244db660890118e969c84de3.tar.gz redmine-e62358253646f7cc244db660890118e969c84de3.zip |
Lazy load inline images (#36294).
Patch by Mizuki ISHIKAWA.
git-svn-id: http://svn.redmine.org/redmine/trunk@21313 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a798261bc..63f80f36a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -320,7 +320,8 @@ module ApplicationHelper image_tag( thumbnail_path(attachment), :srcset => "#{thumbnail_path(attachment, :size => thumbnail_size * 2)} 2x", - :style => "max-width: #{thumbnail_size}px; max-height: #{thumbnail_size}px;" + :style => "max-width: #{thumbnail_size}px; max-height: #{thumbnail_size}px;", + :loading => "lazy" ), attachment_path( attachment @@ -946,7 +947,7 @@ module ApplicationHelper if !desc.blank? && alttext.blank? alt = " title=\"#{desc}\" alt=\"#{desc}\"" end - "src=\"#{image_url}\"#{alt}" + "src=\"#{image_url}\"#{alt} loading=\"lazy\"" else m end |