Skip to content

Commit

Permalink
Hide emoji list after leaving comment reaction (publiclab#9564)
Browse files Browse the repository at this point in the history
  • Loading branch information
TildaDares authored and reginaalyssa committed Oct 16, 2021
1 parent bff579f commit ec720da
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/views/notes/_comment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<% emoji_names.each do |e| %>
<% capitalized_emoji_name = e.split("-").map(&:capitalize).join %>
<% str = "/comment/like?comment_id=#{comment.cid}&user_id=#{current_user.uid}&emoji_type=#{capitalized_emoji_name}" %>
<%= link_to str, data: { method: "post", remote: true }, style: "margin: 6px;" do %>
<%= link_to str, data: { method: "post", remote: true }, style: "margin: 6px;", class: "emoji-btn" do %>
<img alt="React to post" class="emoji grow" height="20" width="20" src="<%= emoji_image_map[e] %>">
<% end %>
<% end %>
Expand Down Expand Up @@ -132,6 +132,13 @@
}
});
});

$('.emoji-btn').click(function() {
setTimeout(() => {
$('#emoji-dropdown').removeClass('show');
$('#dropdownMenuButton').attr('aria-expanded', 'false');
}, 5000);
});
</script>

<div style="border: 1px solid #e7e7e7;padding: 36px;" id="c<%= comment.cid %>show">
Expand Down

0 comments on commit ec720da

Please sign in to comment.