From c1e2b02e34e5038be0c39e11c3172c3375dc0734 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Tue, 31 May 2016 22:32:29 +0300 Subject: Added tests for award emoji feature. --- app/assets/javascripts/awards_handler.coffee | 20 ++++++++++---------- app/assets/stylesheets/pages/notes.scss | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/awards_handler.coffee b/app/assets/javascripts/awards_handler.coffee index e01c5d68c43..4f4009e6db0 100644 --- a/app/assets/javascripts/awards_handler.coffee +++ b/app/assets/javascripts/awards_handler.coffee @@ -202,7 +202,7 @@ class @AwardsHandler getAwardTooltip: ($awardBlock) -> - return $awardBlock.attr('data-original-title') or $awardBlock.attr('data-title') + return $awardBlock.attr('data-original-title') or $awardBlock.attr('data-title') or '' removeMeFromUserList: ($emojiButton, emoji) -> @@ -222,7 +222,7 @@ class @AwardsHandler .attr 'data-original-title', newAuthors .attr 'data-title', newAuthors - @resetTooltip(awardBlock) + @resetTooltip awardBlock addMeToUserList: (votesBlock, emoji) -> @@ -232,21 +232,21 @@ class @AwardsHandler users = [] if origTitle - users = origTitle.trim().split(', ') + users = origTitle.trim().split ', ' - users.push('me') - awardBlock.attr('title', users.join(', ')) + users.push 'me' + awardBlock.attr 'title', users.join ', ' - @resetTooltip(awardBlock) + @resetTooltip awardBlock resetTooltip: (award) -> - award.tooltip('destroy') + + award.tooltip 'destroy' # 'destroy' call is asynchronous and there is no appropriate callback on it, this is why we need to set timeout. - setTimeout (-> - award.tooltip() - ), 200 + cb = -> award.tooltip() + setTimeout cb, 200 createEmoji_: (votesBlock, emoji) -> diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss index 53a9d1144c8..4ebaf227279 100644 --- a/app/assets/stylesheets/pages/notes.scss +++ b/app/assets/stylesheets/pages/notes.scss @@ -122,7 +122,7 @@ ul.notes { .note-awards { .js-awards-block { - padding: 2px 0; + padding: 2px; margin-top: 10px; } -- cgit v1.2.1