From d458eadb6628998ae5ced5cba53677a8f61967b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 16 Mar 2026 21:07:44 -0400 Subject: [PATCH] add active class to selected filter show no-notifs if there are no unreads --- install/package.json | 2 +- public/src/client/header/notifications.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index ee1a0c15d6..fa702393fb 100644 --- a/install/package.json +++ b/install/package.json @@ -108,7 +108,7 @@ "nodebb-plugin-spam-be-gone": "2.3.2", "nodebb-plugin-web-push": "0.7.7", "nodebb-rewards-essentials": "1.0.2", - "nodebb-theme-harmony": "2.2.58", + "nodebb-theme-harmony": "2.2.59", "nodebb-theme-lavender": "7.1.21", "nodebb-theme-peace": "2.2.57", "nodebb-theme-persona": "14.2.32", diff --git a/public/src/client/header/notifications.js b/public/src/client/header/notifications.js index 71c50ea726..94a23c9ecd 100644 --- a/public/src/client/header/notifications.js +++ b/public/src/client/header/notifications.js @@ -24,7 +24,8 @@ define('forum/header/notifications', function () { dropdownEl.on('click', '[data-filter]', (e) => { const filter = e.target.getAttribute('data-filter'); - + dropdownEl.find('[data-filter]').removeClass('active'); + e.target.classList.add('active'); if (filter === 'unread') { listEl.get(0).querySelectorAll('[data-nid]:not(.unread)').forEach((e) => { e.classList.toggle('hidden', true); @@ -34,6 +35,8 @@ define('forum/header/notifications', function () { e.classList.toggle('hidden', false); }); } + const visibleNotifCount = dropdownEl.find('[data-nid]:not(.hidden)').length; + dropdownEl.find('.no-notifs').toggleClass('hidden', visibleNotifCount !== 0); }); });