mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
added API call for total unread topics; moved unread notification parsing to client side
also fixed a bug where the new notification icon glow would disappear on page refresh even if there were existing notifications.
This commit is contained in:
@@ -126,12 +126,16 @@
|
||||
return tags;
|
||||
},
|
||||
|
||||
refreshTitle: function() {
|
||||
var a = document.createElement('a');
|
||||
refreshTitle: function(url) {
|
||||
if (!url) {
|
||||
var a = document.createElement('a');
|
||||
a.href = document.location;
|
||||
url = a.pathname.slice(1);
|
||||
}
|
||||
|
||||
a.href = document.location;
|
||||
socket.emit('api:meta.buildTitle', a.pathname.slice(1), function(title) {
|
||||
document.title = title;
|
||||
socket.emit('api:meta.buildTitle', url, function(title, numNotifications) {
|
||||
document.title = (numNotifications > 0 ? '(' + numNotifications + ') ' : '') + title;
|
||||
if (numNotifications > 0) document.querySelector('.notifications a i').className = 'icon-circle active';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user