Skip to content

Node.js based forum software built for the modern web

fix: notif dropdown staying open after successive opens

Barış Soner Uşaklı2e5d640df1c0
diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js
index 3649884d01..334a429dbd 100644
--- a/public/src/modules/notifications.js
+++ b/public/src/modules/notifications.js
@@ -61,13 +61,18 @@ define('notifications', [
const nid = notifEl.attr('data-nid');
markNotification(nid, true);
});
- components.get('notifications').on('click', '.mark-all-read', () => {
- Notifications.markAllRead();
- triggerEl?.dropdown('toggle');
- });
- components.get('notifications').on('click', `[href="${config.relative_path}/notifications"]`, () => {
- triggerEl?.dropdown('toggle');
- });
+ const notifComponent = components.get('notifications');
+ notifComponent
+ .off('click', '.mark-all-read')
+ .on('click', '.mark-all-read', () => {
+ Notifications.markAllRead();
+ triggerEl?.dropdown('toggle');
+ });
+ notifComponent
+ .off('click', `[href="${config.relative_path}/notifications"]`)
+ .on('click', `[href="${config.relative_path}/notifications"]`, () => {
+ triggerEl?.dropdown('toggle');
+ });
Notifications.handleUnreadButton(notifList);