From 4457228903a6be483e6cabb94b8a8398c50eec3c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sun, 11 Aug 2013 16:41:49 -0400 Subject: [PATCH] closed #134 --- public/src/forum/footer.js | 2 ++ public/src/utils.js | 9 +++++++++ 2 files changed, 11 insertions(+) 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; + }); } }