- $(".inbox-mark-unread").on("ajax:success", function (event, data) {
- $("#inboxanchor").remove();
- $(".user-button").before(data.inboxanchor);
-
- $("#inbox-count").replaceWith(data.inbox_count);
-
- $(this).parents(".inbox-row").removeClass("inbox-row").addClass("inbox-row-unread");
- });
-
- $(".inbox-mark-read").on("ajax:success", function (event, data) {
- $("#inboxanchor").remove();
- $(".user-button").before(data.inboxanchor);
-
- $("#inbox-count").replaceWith(data.inbox_count);
-
- $(this).parents(".inbox-row-unread").removeClass("inbox-row-unread").addClass("inbox-row");
+ $(".messages-table .destroy-message").on("turbo:submit-end", function (event) {
+ if (event.detail.success) {
+ event.target.dataset.isDestroyed = true;
+ }