From b1aca51c48ea6bb1e65e019c2a2899960a2c6b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 29 Nov 2022 19:08:09 -0500 Subject: [PATCH] fix: notif parent add notifications/count component --- public/src/modules/notifications.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index b8a52c3fcf..d5e9c9ceb5 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -61,7 +61,7 @@ define('notifications', [ notifList.on('click', '.mark-read', function () { const $this = $(this); - const liEl = $this.parents('li'); + const liEl = $this.parents('li[data-nid]'); const unread = liEl.hasClass('unread'); const nid = liEl.attr('data-nid'); markNotification(nid, unread, function () { @@ -138,7 +138,7 @@ define('notifications', [ notifIcon.toggleClass('unread-count', count > 0); notifIcon.attr('data-content', count > 99 ? '99+' : count); - + components.get('notifications/count').toggleClass('hidden', count <= 0).text(count); const payload = { count: count, updateFavicon: true,