From cf649529187170bd60a00029cc5ef41e65df027d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 23 May 2013 14:43:00 -0400 Subject: [PATCH] bugfixing notif window --- public/templates/footer.tpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/templates/footer.tpl b/public/templates/footer.tpl index 3f905de329..2cc7bc02e2 100644 --- a/public/templates/footer.tpl +++ b/public/templates/footer.tpl @@ -107,6 +107,7 @@ } }) socket.on('api:notifications.get', function(data) { + console.log(data); var notifFrag = document.createDocumentFragment(), notifEl = document.createElement('li'), numRead = data.read.length, @@ -123,7 +124,7 @@ for(x=0;x' + utils.relativeTime(data.unread[x].datetime, true) + '' + data.read[x].text + ''; + notifEl.innerHTML = '' + utils.relativeTime(data.read[x].datetime, true) + '' + data.read[x].text + ''; notifFrag.appendChild(notifEl.cloneNode(true)); } } else { @@ -134,7 +135,7 @@ }); socket.on('api:notifications.counts', function(counts) { var notifIcon = document.querySelector('.notifications a i'); - if ((counts.unread + counts.read) > 0) notifIcon.className = 'icon-circle active'; + if (counts.unread > 0) notifIcon.className = 'icon-circle active'; else notifIcon.className = 'icon-circle-blank'; }); socket.emit('api:notifications.counts');