From 7c65471ba41f3d79c91ccea5e386aee27bb88e1c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 17 Mar 2026 12:51:14 -0400 Subject: [PATCH] fix: close notif drawer on item click, fix crash in module --- public/src/modules/notifications.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index 70dc54e3bb..599644848e 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -43,13 +43,13 @@ define('notifications', [ app.parseAndTranslate('partials/notifications_list', { notifications }, function (html) { notifList.html(html); notifList.off('click').on('click', '[component="notifications/item/link"]', function (ev) { - const notifEl = $(this); + const notifEl = $(this).parents('[data-nid]'); if (scrollToPostIndexIfOnPage(notifEl)) { ev.stopPropagation(); ev.preventDefault(); - if (triggerEl) { - triggerEl.dropdown('toggle'); - } + } + if (triggerEl) { + triggerEl.dropdown('toggle'); } const unread = notifEl.hasClass('unread'); @@ -61,6 +61,7 @@ define('notifications', [ }); 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');