From a84c1cb89dbf51b89de3cc966b4ef132a09c7d66 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 30 Apr 2024 06:49:30 +0300 Subject: [PATCH] Remove .message-summary css classes and selectors They are not necessary because they select every table body row, and the table already has its own class. --- app/assets/javascripts/messages.js | 2 +- app/views/messages/_message_summary.html.erb | 2 +- app/views/messages/_sent_message_summary.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/messages.js b/app/assets/javascripts/messages.js index eef06457b..0f5933eba 100644 --- a/app/assets/javascripts/messages.js +++ b/app/assets/javascripts/messages.js @@ -5,7 +5,7 @@ $(document).ready(function () { } }); - $(".messages-table .message-summary").on("turbo:before-morph-element", function (event) { + $(".messages-table tbody tr").on("turbo:before-morph-element", function (event) { if ($(event.target).find("[data-is-destroyed]").length > 0) { event.preventDefault(); // NB: prevent Turbo from morhping/removing this element $(event.target).fadeOut(800, "linear", function () { diff --git a/app/views/messages/_message_summary.html.erb b/app/views/messages/_message_summary.html.erb index 1a7a0c839..a181e96e1 100644 --- a/app/views/messages/_message_summary.html.erb +++ b/app/views/messages/_message_summary.html.erb @@ -1,4 +1,4 @@ -<%= tag.tr(:id => "inbox-#{message.id}", :class => { "message-summary" => true, "table-success" => !message.message_read? }) do %> +<%= tag.tr(:id => "inbox-#{message.id}", :class => { "table-success" => !message.message_read? }) do %> <%= link_to message.sender.display_name, user_path(message.sender) %> <%= link_to message.title, message_path(message) %> <%= l message.sent_on, :format => :friendly %> diff --git a/app/views/messages/_sent_message_summary.html.erb b/app/views/messages/_sent_message_summary.html.erb index cd156aa47..cf10cd462 100644 --- a/app/views/messages/_sent_message_summary.html.erb +++ b/app/views/messages/_sent_message_summary.html.erb @@ -1,4 +1,4 @@ -<%= tag.tr(:id => "outbox-#{message.id}", :class => { "message-summary" => true }) do %> +<%= tag.tr(:id => "outbox-#{message.id}") do %> <%= link_to message.recipient.display_name, user_path(message.recipient) %> <%= link_to message.title, message_path(message) %> <%= l message.sent_on, :format => :friendly %> -- 2.39.5