Commit 004b8554 authored by Valery Sizov's avatar Valery Sizov

Do not show frequently used emojis when empty

parent 854f57e7
...@@ -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