From 3202a52a6198688bb86d185ca48783e996889bd3 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 25 Feb 2015 13:43:21 -0500 Subject: [PATCH] refactored notif dropdown, #2771 --- public/src/modules/notifications.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index d0f92d0230..c58287350e 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -58,10 +58,9 @@ define('notifications', ['sounds'], function(sound) { }); notifList.on('click', '.mark-read', function(e) { - var anchorEl = $(this.parentNode), - parentEl = anchorEl.parent(), - nid = anchorEl.attr('data-nid'), - unread = parentEl.hasClass('unread'); + var liEl = $(this.parentNode), + nid = liEl.siblings('a').attr('data-nid'), + unread = liEl.hasClass('unread'); e.preventDefault(); e.stopPropagation(); @@ -71,7 +70,7 @@ define('notifications', ['sounds'], function(sound) { app.alertError(err.message); } - parentEl.toggleClass('unread'); + liEl.toggleClass('unread'); increaseNotifCount(unread ? -1 : 1); }); });