Commit 797387c6 authored by Valery Sizov's avatar Valery Sizov

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
parents 854f57e7 004b8554
...@@ -134,15 +134,16 @@ class @AwardsHandler ...@@ -134,15 +134,16 @@ class @AwardsHandler
_.compact(_.uniq(frequently_used_emojis)) _.compact(_.uniq(frequently_used_emojis))
renderFrequentlyUsedBlock: -> renderFrequentlyUsedBlock: ->
frequently_used_emojis = @getFrequentlyUsedEmojis() if $.cookie('frequently_used_emojis')
frequently_used_emojis = @getFrequentlyUsedEmojis()
ul = $("<ul>") ul = $("<ul>")
for emoji in frequently_used_emojis for emoji in frequently_used_emojis
do (emoji) -> do (emoji) ->
$(".emoji-menu-content [data-emoji='#{emoji}']").closest("li").clone().appendTo(ul) $(".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: -> setupSearch: ->
$("input.emoji-search").keyup (ev) => $("input.emoji-search").keyup (ev) =>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment