From 39b51e8020d182be588003ed14b778295fec4874 Mon Sep 17 00:00:00 2001 From: Tilda Udufo Date: Tue, 4 May 2021 21:14:37 +0100 Subject: [PATCH] Hide emoji list after leaving comment reaction (#9564) --- app/views/notes/_comment.html.erb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/notes/_comment.html.erb b/app/views/notes/_comment.html.erb index 702e8fee5c..9cd2876938 100644 --- a/app/views/notes/_comment.html.erb +++ b/app/views/notes/_comment.html.erb @@ -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 %> React to post <% end %> <% end %> @@ -132,6 +132,13 @@ } }); }); + + $('.emoji-btn').click(function() { + setTimeout(() => { + $('#emoji-dropdown').removeClass('show'); + $('#dropdownMenuButton').attr('aria-expanded', 'false'); + }, 5000); + });