mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-04-14 00:18:03 +02:00
add active class to selected filter
show no-notifs if there are no unreads
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user