diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-12-28 10:11:01 +0200 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-12-28 10:11:05 +0200 |
commit | 004b85540f2542a0c4bbdf62bd19db71adee7917 (patch) | |
tree | 327abb0e43fa6cd15d83dde39f6ac98b3d5cbc19 /app/assets/javascripts/awards_handler.coffee | |
parent | 854f57e732c03eb821ec93142c970f1579a0e949 (diff) | |
download | gitlab-ce-004b85540f2542a0c4bbdf62bd19db71adee7917.tar.gz |
Do not show frequently used emojis when empty
Diffstat (limited to 'app/assets/javascripts/awards_handler.coffee')
-rw-r--r-- | app/assets/javascripts/awards_handler.coffee | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/assets/javascripts/awards_handler.coffee b/app/assets/javascripts/awards_handler.coffee index eb1c3669032..619abb1fb07 100644 --- a/app/assets/javascripts/awards_handler.coffee +++ b/app/assets/javascripts/awards_handler.coffee @@ -134,15 +134,16 @@ class @AwardsHandler _.compact(_.uniq(frequently_used_emojis)) renderFrequentlyUsedBlock: -> - frequently_used_emojis = @getFrequentlyUsedEmojis() + if $.cookie('frequently_used_emojis') + frequently_used_emojis = @getFrequentlyUsedEmojis() - ul = $("<ul>") + ul = $("<ul>") - for emoji in frequently_used_emojis - do (emoji) -> - $(".emoji-menu-content [data-emoji='#{emoji}']").closest("li").clone().appendTo(ul) + for emoji in frequently_used_emojis + do (emoji) -> + $(".emoji-menu-content [data-emoji='#{emoji}']").closest("li").clone().appendTo(ul) - $("input.emoji-search").after(ul).after($("<h5>").text("Frequently used")) + $("input.emoji-search").after(ul).after($("<h5>").text("Frequently used")) setupSearch: -> $("input.emoji-search").keyup (ev) => |