summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <mail@zjvandeweg.nl>2016-01-15 16:04:48 +0100
committerZeger-Jan van de Weg <mail@zjvandeweg.nl>2016-01-17 19:10:03 +0100
commit182cc843b02a6773b8650b4e0f2e42a099bef0bd (patch)
tree4a17cee471c87716b0ded40bdbf372a5eacada51 /app
parenta6e073fa9b0d78181609962b269f8d9d240f99ac (diff)
downloadgitlab-ce-182cc843b02a6773b8650b4e0f2e42a099bef0bd.tar.gz
Remove leading comma when user is the only one to award that emoji
Fixes #9073
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/awards_handler.coffee13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/assets/javascripts/awards_handler.coffee b/app/assets/javascripts/awards_handler.coffee
index 619abb1fb07..8b7e0723f6f 100644
--- a/app/assets/javascripts/awards_handler.coffee
+++ b/app/assets/javascripts/awards_handler.coffee
@@ -19,7 +19,7 @@ class @AwardsHandler
@addAwardToEmojiBar(emoji)
$(".emoji-menu").hide()
-
+
addAwardToEmojiBar: (emoji) ->
@addEmojiToFrequentlyUsedList(emoji)
@@ -66,9 +66,14 @@ class @AwardsHandler
addMeToAuthorList: (emoji) ->
award_block = @findEmojiIcon(emoji).parent()
- authors = award_block.attr("data-original-title").split(", ")
+ authors = _.compact(award_block.attr("data-original-title").split(", "))
authors.push("me")
- award_block.attr("title", authors.join(", "))
+
+ if authors.length == 1
+ award_block.attr("title", "me")
+ else
+ award_block.attr("title", authors.join(", "))
+
@resetTooltip(award_block)
resetTooltip: (award) ->
@@ -78,7 +83,7 @@ class @AwardsHandler
setTimeout (->
award.tooltip()
), 200
-
+
createEmoji: (emoji) ->
emojiCssClass = @resolveNameToCssClass(emoji)