Commit 59b34188 authored by Fatih Acet's avatar Fatih Acet Committed by Z.J. van de Weg

Animate emoji when rendered.

parent ce572913
...@@ -126,6 +126,7 @@ class @AwardsHandler ...@@ -126,6 +126,7 @@ class @AwardsHandler
counter.text parseInt(counter.text()) + 1 counter.text parseInt(counter.text()) + 1
$emojiBtn.addClass 'active' $emojiBtn.addClass 'active'
@addMeToUserList votesBlock, emoji @addMeToUserList votesBlock, emoji
@animateEmoji $emojiBtn
else else
votesBlock.removeClass 'hidden' votesBlock.removeClass 'hidden'
@createEmoji votesBlock, emoji @createEmoji votesBlock, emoji
...@@ -242,15 +243,25 @@ class @AwardsHandler ...@@ -242,15 +243,25 @@ class @AwardsHandler
<span class='award-control-text js-counter'>1</span> <span class='award-control-text js-counter'>1</span>
</button>" </button>"
emoji_node = $(buttonHtml) $emojiButton = $ buttonHtml
emoji_node = $emojiButton
.insertBefore votesBlock.find '.js-award-holder:not(.js-award-action-btn)' .insertBefore votesBlock.find '.js-award-holder:not(.js-award-action-btn)'
.find '.emoji-icon' .find '.emoji-icon'
.data 'emoji', emoji .data 'emoji', emoji
@animateEmoji $emojiButton
$('.award-control').tooltip() $('.award-control').tooltip()
votesBlock.removeClass 'current' votesBlock.removeClass 'current'
animateEmoji: ($emoji) ->
className = 'pulse animated'
$emoji.addClass className
setTimeout (-> $emoji.removeClass className), 321
createEmoji: (votesBlock, emoji) -> createEmoji: (votesBlock, emoji) ->
if $('.emoji-menu').length if $('.emoji-menu').length
......
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