Hi,
When I click on Mark all read on Notification icon, the icon moves toward message icon. Refreshing page or browsing makes it OK again.
Any solution to this ?
Thank you.
Clicking Mark all read makes notification icon move right - ProLight
-
- Registered User
- Posts: 216
- Joined: Mon Feb 05, 2024 11:41 am
Re: Clicking Mark all read makes notification icon move righ
Hello,
Because there is a class added in the HTML if a badge is displayed (with the number of notifications).
But this class is not removed directly when you click on ‘Mark all read’, only when the page is refreshed.
One solution would be to extend the AJAX function to remove the class at the same time as the badge.
Untested but you can try by adding something like this to overall_footer.html (before
Because there is a class added in the HTML if a badge is displayed (with the number of notifications).
But this class is not removed directly when you click on ‘Mark all read’, only when the page is refreshed.
One solution would be to extend the AJAX function to remove the class at the same time as the badge.
Untested but you can try by adding something like this to overall_footer.html (before
EVENT overall_footer_body_after
):
Code: Select all
<script>
var originalMarkNotifications = phpbb.markNotifications;
phpbb.markNotifications = function($popup, unreadCount) {
originalMarkNotifications($popup, unreadCount);
if (!unreadCount) {
$('#notification_list_button').parent().removeClass('light-badge-count');
}
};
</script>
-
- Registered User
- Posts: 797
- Joined: Sat Jan 07, 2012 4:16 pm
Re: Clicking Mark all read makes notification icon move righ
Worked like a charm! Thank you very much.cabot wrote: Hello,
Because there is a class added in the HTML if a badge is displayed (with the number of notifications).
But this class is not removed directly when you click on ‘Mark all read’, only when the page is refreshed.
One solution would be to extend the AJAX function to remove the class at the same time as the badge.
Untested but you can try by adding something like this to overall_footer.html (beforeEVENT overall_footer_body_after
):Code: Select all
<script> var originalMarkNotifications = phpbb.markNotifications; phpbb.markNotifications = function($popup, unreadCount) { originalMarkNotifications($popup, unreadCount); if (!unreadCount) { $('#notification_list_button').parent().removeClass('light-badge-count'); } }; </script>
-
- Registered User
- Posts: 216
- Joined: Mon Feb 05, 2024 11:41 am