summaryrefslogtreecommitdiff
path: root/app/views/votes
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-11-17 16:44:58 +0200
committerValery Sizov <vsv2711@gmail.com>2015-11-19 01:25:59 +0200
commit36d0442e837cd520dec780590040c83108bc14e6 (patch)
tree04396adae6bb5bc33934a074d5a5c1525941e2d7 /app/views/votes
parent06a4fd1035c58d89251fb979dafa8610ba8c5157 (diff)
downloadgitlab-ce-36d0442e837cd520dec780590040c83108bc14e6.tar.gz
replace emoji references from class name to data [ci skip]
Diffstat (limited to 'app/views/votes')
-rw-r--r--app/views/votes/_votes_block.html.haml10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/views/votes/_votes_block.html.haml b/app/views/votes/_votes_block.html.haml
index 7f988160ad9..118a095181f 100644
--- a/app/views/votes/_votes_block.html.haml
+++ b/app/views/votes/_votes_block.html.haml
@@ -1,7 +1,7 @@
.awards.votes-block
- votable.notes.awards.grouped_awards.each do | vote |
.award{class: ("active" if vote.last.pluck(:author_id).include?(current_user.id))}
- .icon{class: "emoji-#{vote.first}"}
+ .icon{"data-emoji" => "#{vote.first}"}
= image_tag url_to_emoji(vote.first), height: "20px", width: "20px"
.counter
= vote.last.count
@@ -10,22 +10,22 @@
%a#add-award{"data-toggle" => "dropdown", "data-target" => "#", "href" => "#"} +
%ul.dropdown-menu.awards-menu
- ["100", "blush", "heart", "smile", "rage", "beers", "thumbsup", "disappointed", "ok_hand", "helicopter"].each do |emoji|
- %li{class: "emoji-#{emoji}"}= image_tag url_to_emoji(emoji), height: "20px", width: "20px"
+ %li{"data-emoji" => "#{emoji}"}= image_tag url_to_emoji(emoji), height: "20px", width: "20px"
:coffeescript
post_emoji_url = "#{award_toggle_namespace_project_notes_path(@project.namespace, @project)}"
noteable_type = "Issue"
noteable_id = #{@issue.id}
- awards_handler = new AwardsHandler(post_emoji_url, noteable_type, noteable_id)
+ window.awards_handler = new AwardsHandler(post_emoji_url, noteable_type, noteable_id)
$ ->
$(".awards-menu li").click (e)->
- emoji = $(this).attr("class")
+ emoji = $(this).data("emoji")
awards_handler.addAward(emoji)
$(".awards").on "click", ".award", (e)->
- emoji = /(emoji-\S*)/.exec($(this).find(".icon").attr("class"))[0]
+ emoji = $(this).find(".icon").data("emoji")
awards_handler.addAward(emoji)