Node.js based forum software built for the modern web
add active class to selected filter
Barış Soner Uşaklıd458eadb6628
diff --git a/install/package.json b/install/package.jsonindex 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.jsindex 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);});});