Commit 47fc235f authored by Fatih Acet's avatar Fatih Acet Committed by Z.J. van de Weg

Be consistent on naming.

It was named as $emojiBtn before I was using $emojiButton so updated them to be consistent.
parent 59b34188
...@@ -116,17 +116,17 @@ class @AwardsHandler ...@@ -116,17 +116,17 @@ class @AwardsHandler
@addEmojiToFrequentlyUsedList emoji @addEmojiToFrequentlyUsedList emoji
emoji = @normilizeEmojiName emoji emoji = @normilizeEmojiName emoji
$emojiBtn = @findEmojiIcon(votesBlock, emoji).parent() $emojiButton = @findEmojiIcon(votesBlock, emoji).parent()
if $emojiBtn.length > 0 if $emojiButton.length > 0
if @isActive $emojiBtn if @isActive $emojiButton
@decrementCounter $emojiBtn, emoji @decrementCounter $emojiButton, emoji
else else
counter = $emojiBtn.find '.js-counter' counter = $emojiButton.find '.js-counter'
counter.text parseInt(counter.text()) + 1 counter.text parseInt(counter.text()) + 1
$emojiBtn.addClass 'active' $emojiButton.addClass 'active'
@addMeToUserList votesBlock, emoji @addMeToUserList votesBlock, emoji
@animateEmoji $emojiBtn @animateEmoji $emojiButton
else else
votesBlock.removeClass 'hidden' votesBlock.removeClass 'hidden'
@createEmoji votesBlock, emoji @createEmoji votesBlock, emoji
...@@ -153,32 +153,32 @@ class @AwardsHandler ...@@ -153,32 +153,32 @@ class @AwardsHandler
@addAward votesBlock, awardUrl, mutualVote, no if isAlreadyVoted @addAward votesBlock, awardUrl, mutualVote, no if isAlreadyVoted
isActive: ($emojiBtn) -> $emojiBtn.hasClass 'active' isActive: ($emojiButton) -> $emojiButton.hasClass 'active'
decrementCounter: ($emojiBtn, emoji) -> decrementCounter: ($emojiButton, emoji) ->
counter = $('.js-counter', $emojiBtn) counter = $('.js-counter', $emojiButton)
counterNumber = parseInt counter.text(), 10 counterNumber = parseInt counter.text(), 10
if counterNumber > 1 if counterNumber > 1
counter.text counterNumber - 1 counter.text counterNumber - 1
@removeMeFromUserList $emojiBtn, emoji @removeMeFromUserList $emojiButton, emoji
else if emoji is 'thumbsup' or emoji is 'thumbsdown' else if emoji is 'thumbsup' or emoji is 'thumbsdown'
$emojiBtn.tooltip 'destroy' $emojiButton.tooltip 'destroy'
counter.text '0' counter.text '0'
@removeMeFromUserList $emojiBtn, emoji @removeMeFromUserList $emojiButton, emoji
@removeEmoji $emojiBtn if $emojiBtn.parents('.note').length @removeEmoji $emojiButton if $emojiButton.parents('.note').length
else else
@removeEmoji $emojiBtn @removeEmoji $emojiButton
$emojiBtn.removeClass 'active' $emojiButton.removeClass 'active'
removeEmoji: ($emojiBtn) -> removeEmoji: ($emojiButton) ->
$emojiBtn.tooltip('destroy') $emojiButton.tooltip('destroy')
$emojiBtn.remove() $emojiButton.remove()
$votesBlock = @getVotesBlock() $votesBlock = @getVotesBlock()
...@@ -191,9 +191,9 @@ class @AwardsHandler ...@@ -191,9 +191,9 @@ class @AwardsHandler
return $awardBlock.attr('data-original-title') or $awardBlock.attr('data-title') return $awardBlock.attr('data-original-title') or $awardBlock.attr('data-title')
removeMeFromUserList: ($emojiBtn, emoji) -> removeMeFromUserList: ($emojiButton, emoji) ->
awardBlock = $emojiBtn awardBlock = $emojiButton
originalTitle = @getAwardTooltip awardBlock originalTitle = @getAwardTooltip awardBlock
authors = originalTitle.split ', ' authors = originalTitle.split ', '
......
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