-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update notifications counter in Bottom Nav with AJAX
Notifications counter did not update in real-time, when marking a notification as read/unread. Only when page was refreshed, it was updated. The commit changes the behavior to use AJAX and update the counter every time when action on notification is performed, so that there is no need to update the page to see the actual amount of unread notifications in the counter.
- Loading branch information
Oleksandr Orlov
committed
Oct 5, 2020
1 parent
70a164c
commit 21da235
Showing
4 changed files
with
7 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/api/app/views/layouts/webui/responsive_ux/_unread_notifications_counter.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
$('#filters').html("<%= j(render partial: 'notifications_filter', locals: { filter: notifications_filter }) %>"); | ||
$('#notifications-list').html("<%= j(render partial: 'notifications_list', locals: { notifications: notifications, selected_filter: notifications_filter.selected_filter }) %>"); | ||
$('#flash').html("<%= escape_javascript(render(layout: false, partial: 'layouts/webui/flash', object: flash)) %>"); | ||
$('#notifications-counter').html("<%= escape_javascript(render partial: 'layouts/webui/responsive_ux/unread_notifications_counter') %>"); | ||
$('#top-notifications-counter, #bottom-notifications-counter').html("<%= escape_javascript(render partial: 'layouts/webui/responsive_ux/unread_notifications_counter') %>"); | ||
$(document).ready(function() { handleNotificationCheckboxSelection(); }); |