refactored notif dropdown, #2771

v1.18.x
Julian Lam 10 years ago
parent 0c903672d0
commit 3202a52a61

@ -58,10 +58,9 @@ define('notifications', ['sounds'], function(sound) {
}); });
notifList.on('click', '.mark-read', function(e) { notifList.on('click', '.mark-read', function(e) {
var anchorEl = $(this.parentNode), var liEl = $(this.parentNode),
parentEl = anchorEl.parent(), nid = liEl.siblings('a').attr('data-nid'),
nid = anchorEl.attr('data-nid'), unread = liEl.hasClass('unread');
unread = parentEl.hasClass('unread');
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
@ -71,7 +70,7 @@ define('notifications', ['sounds'], function(sound) {
app.alertError(err.message); app.alertError(err.message);
} }
parentEl.toggleClass('unread'); liEl.toggleClass('unread');
increaseNotifCount(unread ? -1 : 1); increaseNotifCount(unread ? -1 : 1);
}); });
}); });

Loading…
Cancel
Save