moved refreshTitle into app.js, messaging someone now invokes an alternating title, hehe

This commit is contained in:
Julian Lam
2013-12-05 23:24:47 -05:00
parent 385aa6df92
commit b81737bc0f
6 changed files with 46 additions and 26 deletions

View File

@@ -169,23 +169,6 @@
return tags;
},
refreshTitle: function(url) {
if (!url) {
var a = document.createElement('a');
a.href = document.location;
url = a.pathname.slice(1);
}
var notificationIcon;
socket.emit('api:meta.buildTitle', url, function(title, numNotifications) {
document.title = (numNotifications > 0 ? '(' + numNotifications + ') ' : '') + title;
notificationIcon = notificationIcon || document.querySelector('.notifications a i');
if (numNotifications > 0 && notificationIcon) {
notificationIcon.className = 'fa fa-circle active';
}
});
},
isRelativeUrl: function(url) {
var firstChar = url.slice(0, 1);
return (firstChar === '.' || firstChar === '/');