From aa2978976c56ccd52b1cbdfc90891d9eacba7e2e Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Tue, 21 Jan 2014 12:35:34 -0500 Subject: [PATCH] notif fix --- public/src/modules/notifications.js | 2 +- src/user.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index 8994ba008a..2fff715165 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -21,7 +21,7 @@ define(function() { if (!err && (data.read.length + data.unread.length) > 0) { for (x = 0; x < numUnread; x++) { notifEl.setAttribute('data-nid', data.unread[x].nid); - notifEl.className = 'unread'; + notifEl.className = data.unread[x].readClass; notifEl.innerHTML = '' + utils.relativeTime(data.unread[x].datetime, true) + '' + data.unread[x].text + ''; notifFrag.appendChild(notifEl.cloneNode(true)); } diff --git a/src/user.js b/src/user.js index 2ec7bf70cb..a08b6eb982 100644 --- a/src/user.js +++ b/src/user.js @@ -933,6 +933,7 @@ var bcrypt = require('bcrypt'), notifications.get(nid, uid, function(notif_data) { // If the notification could not be found, silently drop it if (notif_data) { + notif_data.readClass = !notif_data.read ? 'label-warning' : ''; unread.push(notif_data); } else { db.sortedSetRemove('uid:' + uid + ':notifications:unread', nid);