summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/awards_handler.coffee
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2015-12-24 16:35:45 +0200
committerValery Sizov <valery@gitlab.com>2015-12-24 16:40:10 +0200
commit355e62eb498de90f91ac129af94d4a0f2ec6b129 (patch)
tree7ac37fea8e0d5f43b3b5c1692a9143096a022d0a /app/assets/javascripts/awards_handler.coffee
parenta55b653d938e5ca5464c48174da3adce84cab275 (diff)
downloadgitlab-ce-355e62eb498de90f91ac129af94d4a0f2ec6b129.tar.gz
added default for frequently used emojis
Diffstat (limited to 'app/assets/javascripts/awards_handler.coffee')
-rw-r--r--app/assets/javascripts/awards_handler.coffee16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/assets/javascripts/awards_handler.coffee b/app/assets/javascripts/awards_handler.coffee
index bb17427852d..04bf5cc7bb5 100644
--- a/app/assets/javascripts/awards_handler.coffee
+++ b/app/assets/javascripts/awards_handler.coffee
@@ -127,19 +127,21 @@ class @AwardsHandler
getFrequentlyUsedEmojis: ->
frequently_used_emojis = ($.cookie('frequently_used_emojis') || "").split(",")
+
+ frequently_used_emojis = ["thumbsup", "thumbsdown"].concat(frequently_used_emojis)
+
_.compact(_.uniq(frequently_used_emojis))
renderFrequentlyUsedBlock: ->
- if $.cookie('frequently_used_emojis')
- frequently_used_emojis = @getFrequentlyUsedEmojis()
+ 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) =>