diff options
author | Valery Sizov <valery@gitlab.com> | 2015-12-28 12:46:21 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-12-28 12:46:21 +0300 |
commit | 797387c66fc61836aa89b5c7e092b248dd332b29 (patch) | |
tree | 327abb0e43fa6cd15d83dde39f6ac98b3d5cbc19 | |
parent | 854f57e732c03eb821ec93142c970f1579a0e949 (diff) | |
parent | 004b85540f2542a0c4bbdf62bd19db71adee7917 (diff) |
Merge branch 'fix_frequently_emojis' into 'master'
[emoji-picker] Do not show frequently used category when it's empty
I added one condition.
See merge request !2221
-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) => |