Skip to content

Commit

Permalink
fix: update message deletion handling and improve close button functi… (
Browse files Browse the repository at this point in the history
#4907)

fix: update message deletion handling and improve close button functionality
  • Loading branch information
bbodine1 committed Jan 23, 2025
1 parent e7db451 commit bf0085e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ $('#inbox-messages').show().html("<%= escape_javascript(render "benefit_sponsors
var bs4 = document.documentElement.dataset.bs4 == "true";
if (bs4) {
$("#messageDeleted").removeClass("hidden");

$("#close-delete-message").on('click', function() {
$("#messageDeleted").addClass("hidden");
});
} else {
<% if @inbox_provider != current_user.person%>
location.reload();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@
<%= l10n("broker_agencies.message_deleted") %>
</div>
<div class="d-flex pl-1">
<span id="close" class="close-icon icon icon-sm pr-1" alt='<%= l10n("close") %>' href="javascript;" tabindex="0" data-keydown-id="close"><span class="sr-only"><%= l10n("close") %></span></span>
<span id="close-delete-message" class="close-icon icon icon-sm pr-1" alt='<%= l10n("close") %>' href="#" tabindex="0" data-keydown-id="close-delete-message"><span class="sr-only"><%= l10n("close") %></span></span>
</div>
</div>
</div>

<script>
$("#close").on('click', function() {
$("#messageDeleted").addClass("hidden");
});
</script>

<% @folder = (params[:folder] || 'Inbox').capitalize %>
<% sorted_inbox_messages = provider.inbox.messages.select{|m| @folder == (m.folder.try(:capitalize) || 'Inbox') }.sort_by(&:created_at).reverse %>
<div id="inbox-messages" class="mx-0 px-0">
Expand Down

0 comments on commit bf0085e

Please sign in to comment.