Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/lazy_image_tag_helper.rb')
-rw-r--r--app/helpers/lazy_image_tag_helper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/lazy_image_tag_helper.rb b/app/helpers/lazy_image_tag_helper.rb
index 603b9438e35..ac987a04895 100644
--- a/app/helpers/lazy_image_tag_helper.rb
+++ b/app/helpers/lazy_image_tag_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module LazyImageTagHelper
def placeholder_image
"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
@@ -11,9 +13,11 @@ module LazyImageTagHelper
options[:data] ||= {}
options[:data][:src] = path_to_image(source)
- options[:class] ||= ""
- options[:class] << " lazy"
+ # options[:class] can be either String or Array.
+ klass_opts = Array.wrap(options[:class])
+ klass_opts << "lazy"
+ options[:class] = klass_opts.join(' ')
source = placeholder_image
end