They are not necessary because they select every table body row, and the table already has its own class.
- $(".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 () {
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 () {
-<%= 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 %>
<td><%= link_to message.sender.display_name, user_path(message.sender) %></td>
<td><%= link_to message.title, message_path(message) %></td>
<td class="text-nowrap"><%= l message.sent_on, :format => :friendly %></td>
<td><%= link_to message.sender.display_name, user_path(message.sender) %></td>
<td><%= link_to message.title, message_path(message) %></td>
<td class="text-nowrap"><%= l message.sent_on, :format => :friendly %></td>
-<%= tag.tr(:id => "outbox-#{message.id}", :class => { "message-summary" => true }) do %>
+<%= tag.tr(:id => "outbox-#{message.id}") do %>
<td><%= link_to message.recipient.display_name, user_path(message.recipient) %></td>
<td><%= link_to message.title, message_path(message) %></td>
<td class="text-nowrap"><%= l message.sent_on, :format => :friendly %></td>
<td><%= link_to message.recipient.display_name, user_path(message.recipient) %></td>
<td><%= link_to message.title, message_path(message) %></td>
<td class="text-nowrap"><%= l message.sent_on, :format => :friendly %></td>