diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-16 18:35:28 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-03-17 06:30:58 +0300 |
commit | 18ab4ac7f4c1308b50b512c868cdc5e4091c92ed (patch) | |
tree | 4f0fedebe8ca27b7a12d7fee23825f1383584505 /lib | |
parent | 16f3e29a660d5c671963fe9b927fdcac3b15d081 (diff) |
Merge branch '29529-quick-fix' into 'master'
Ensure not valid anymore labels don't break issue pages
Closes #29529
See merge request !9995
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/emoji.rb | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/gitlab/emoji.rb b/lib/gitlab/emoji.rb index 35871fd1b7b..a16d9fc2265 100644 --- a/lib/gitlab/emoji.rb +++ b/lib/gitlab/emoji.rb @@ -44,27 +44,17 @@ module Gitlab end # CSS sprite fallback takes precedence over image fallback - def gl_emoji_tag(name, image: false, sprite: false, force_fallback: false) + def gl_emoji_tag(name) emoji_name = emojis_aliases[name] || name emoji_info = emojis[emoji_name] - emoji_fallback_image_source = ActionController::Base.helpers.url_to_image("emoji/#{emoji_info['name']}.png") - emoji_fallback_sprite_class = "emoji-#{emoji_name}" + return unless emoji_info data = { name: emoji_name, unicode_version: emoji_unicode_version(emoji_name) } - data[:fallback_src] = emoji_fallback_image_source if image - data[:fallback_sprite_class] = emoji_fallback_sprite_class if sprite - ActionController::Base.helpers.content_tag 'gl-emoji', - class: ("emoji-icon #{emoji_fallback_sprite_class}" if force_fallback && sprite), - data: data do - if force_fallback && !sprite - emoji_image_tag(emoji_name, emoji_fallback_image_source) - else - emoji_info['moji'] - end - end + + ActionController::Base.helpers.content_tag('gl-emoji', emoji_info['moji'], data: data) end end end |