mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
fixes notification header icon
This commit is contained in:
@@ -6,7 +6,7 @@ define(function() {
|
|||||||
var notifContainer = document.getElementsByClassName('notifications')[0],
|
var notifContainer = document.getElementsByClassName('notifications')[0],
|
||||||
notifTrigger = notifContainer.querySelector('a'),
|
notifTrigger = notifContainer.querySelector('a'),
|
||||||
notifList = document.getElementById('notif-list'),
|
notifList = document.getElementById('notif-list'),
|
||||||
notifIcon = $('.notifications a');
|
notifIcon = $('.notifications a i');
|
||||||
|
|
||||||
notifTrigger.addEventListener('click', function(e) {
|
notifTrigger.addEventListener('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -46,14 +46,14 @@ define(function() {
|
|||||||
notifList.appendChild(notifFrag);
|
notifList.appendChild(notifFrag);
|
||||||
|
|
||||||
if (data.unread.length > 0) {
|
if (data.unread.length > 0) {
|
||||||
notifIcon.toggleClass('active', true);
|
notifIcon.removeClass('fa-bell-o').addClass('fa-bell');
|
||||||
} else {
|
} else {
|
||||||
notifIcon.toggleClass('active', false);
|
notifIcon.removeClass('fa-bell').addClass('fa-bell-o');
|
||||||
}
|
}
|
||||||
|
|
||||||
socket.emit('modules.notifications.mark_all_read', null, function(err) {
|
socket.emit('modules.notifications.mark_all_read', null, function(err) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
notifIcon.toggleClass('active', false);
|
notifIcon.removeClass('fa-bell').addClass('fa-bell-o');
|
||||||
app.refreshTitle();
|
app.refreshTitle();
|
||||||
|
|
||||||
// Update favicon + local count
|
// Update favicon + local count
|
||||||
@@ -87,9 +87,9 @@ define(function() {
|
|||||||
var updateNotifCount = function(count) {
|
var updateNotifCount = function(count) {
|
||||||
// Update notification icon, if necessary
|
// Update notification icon, if necessary
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
notifIcon.toggleClass('active', true);
|
notifIcon.removeClass('fa-bell-o').addClass('fa-bell');
|
||||||
} else {
|
} else {
|
||||||
notifIcon.toggleClass('active', false);
|
notifIcon.removeClass('fa-bell').addClass('fa-bell-o');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the favicon + saved local count
|
// Update the favicon + saved local count
|
||||||
@@ -106,7 +106,9 @@ define(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on('event:new_notification', function() {
|
socket.on('event:new_notification', function() {
|
||||||
notifIcon.toggleClass('active', true);
|
|
||||||
|
notifIcon.removeClass('fa-bell-o').addClass('fa-bell');
|
||||||
|
|
||||||
app.alert({
|
app.alert({
|
||||||
alert_id: 'new_notif',
|
alert_id: 'new_notif',
|
||||||
title: 'New notification',
|
title: 'New notification',
|
||||||
|
|||||||
Reference in New Issue
Block a user