diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-07-24 17:36:52 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2017-07-24 17:36:52 +0000 |
commit | 52b8a0db689c2df968776a1f369ea6a6db245d39 (patch) | |
tree | 4955f45d5d19c1d32aee8bc496041acdd74763cb /app/helpers/avatars_helper.rb | |
parent | 3a26bce80eb739ca3f552dfe71e39b9a177eb36e (diff) | |
download | gitlab-ce-52b8a0db689c2df968776a1f369ea6a6db245d39.tar.gz |
Resolve "Lazy load images on the Frontend"
Diffstat (limited to 'app/helpers/avatars_helper.rb')
-rw-r--r-- | app/helpers/avatars_helper.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index bbe7f3c8fb4..0e068d4b51c 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -11,17 +11,12 @@ module AvatarsHelper def user_avatar_without_link(options = {}) avatar_size = options[:size] || 16 user_name = options[:user].try(:name) || options[:user_name] - css_class = options[:css_class] || '' avatar_url = options[:url] || avatar_icon(options[:user] || options[:user_email], avatar_size) data_attributes = { container: 'body' } - if options[:lazy] - data_attributes[:src] = avatar_url - end - image_tag( - options[:lazy] ? '' : avatar_url, - class: "avatar has-tooltip s#{avatar_size} #{css_class}", + avatar_url, + class: %W[avatar has-tooltip s#{avatar_size}].push(*options[:css_class]), alt: "#{user_name}'s avatar", title: user_name, data: data_attributes |