Merge branch 'awardemoji-tooltip-shows-people-multiple-times' into 'master'
Fixes tooltip doesn't duplicate the "me" name. Checks that "me" is not in the array of names in tooltip ![emojilist](/uploads/20b1a39cda194358f9730ec3c6b86acb/emojilist.gif) Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/7978 See merge request !2454
This commit is contained in:
commit
7c01a91bb7
1 changed files with 7 additions and 10 deletions
|
@ -44,7 +44,6 @@ class @AwardsHandler
|
|||
decrementCounter: (emoji) ->
|
||||
counter = @findEmojiIcon(emoji).siblings(".counter")
|
||||
emojiIcon = counter.parent()
|
||||
|
||||
if parseInt(counter.text()) > 1
|
||||
counter.text(parseInt(counter.text()) - 1)
|
||||
emojiIcon.removeClass("active")
|
||||
|
@ -60,20 +59,18 @@ class @AwardsHandler
|
|||
removeMeFromAuthorList: (emoji) ->
|
||||
award_block = @findEmojiIcon(emoji).parent()
|
||||
authors = award_block.attr("data-original-title").split(", ")
|
||||
authors = _.without(authors, "me").join(", ")
|
||||
award_block.attr("title", authors)
|
||||
authors.splice(authors.indexOf("me"),1)
|
||||
award_block.closest(".award").attr("data-original-title", authors.join(", "))
|
||||
@resetTooltip(award_block)
|
||||
|
||||
addMeToAuthorList: (emoji) ->
|
||||
award_block = @findEmojiIcon(emoji).parent()
|
||||
authors = _.compact(award_block.attr("data-original-title").split(", "))
|
||||
origTitle = award_block.attr("data-original-title").trim()
|
||||
authors = []
|
||||
if origTitle
|
||||
authors = origTitle.split(', ')
|
||||
authors.push("me")
|
||||
|
||||
if authors.length == 1
|
||||
award_block.attr("title", "me")
|
||||
else
|
||||
award_block.attr("title", authors.join(", "))
|
||||
|
||||
award_block.attr("title", authors.join(", "))
|
||||
@resetTooltip(award_block)
|
||||
|
||||
resetTooltip: (award) ->
|
||||
|
|
Loading…
Reference in a new issue