Skip to content

Node.js based forum software built for the modern web

closed #134

Julian Lam4457228903a6
diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js
index e422356ded..a40670d4e8 100644
--- a/public/src/forum/footer.js
+++ b/public/src/forum/footer.js
@@ -93,6 +93,7 @@
socket.emit('api:notifications.get');
socket.emit('api:notifications.mark_all_read', null, function() {
notifIcon.className = 'icon-circle-blank';
+ utils.refreshTitle();
});
}
});
@@ -139,6 +140,7 @@
});
socket.on('event:new_notification', function() {
document.querySelector('.notifications a i').className = 'icon-circle active';
+ utils.refreshTitle();
});
diff --git a/public/src/utils.js b/public/src/utils.js
index fc7ed3d73e..5305fe2305 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -124,6 +124,15 @@
}
return tags;
+ },
+
+ refreshTitle: function() {
+ var a = document.createElement('a');
+
+ a.href = document.location;
+ socket.emit('api:meta.buildTitle', a.pathname.slice(1), function(title) {
+ document.title = title;
+ });
}
}