From 95b553f95386b451ff109953059a29f4302a1a43 Mon Sep 17 00:00:00 2001 From: Steven Fuchs Date: Fri, 23 Dec 2011 23:01:18 -0500 Subject: [PATCH] notifications popup menu should use functions from regular notification object. --- public/javascripts/widgets/notifications-badge.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/javascripts/widgets/notifications-badge.js b/public/javascripts/widgets/notifications-badge.js index e64d5da39..f8499ffce 100644 --- a/public/javascripts/widgets/notifications-badge.js +++ b/public/javascripts/widgets/notifications-badge.js @@ -63,6 +63,7 @@ $.each(notifications, function(index, notification) { var notificationElement = $("
") .addClass("notification_element") + .data( "guid", notification.id ) .html(notification.translation) .prepend($("", { src: notification.actors[0].avatar })) .append("
") @@ -73,16 +74,18 @@ .appendTo(self.dropdownNotifications); notificationElement.find("abbr.timeago").timeago(); + notificationElement.click(Diaspora.page.header.notifications.messageClick); if(notification.unread) { notificationElement.addClass("unread"); $.ajax({ url: "/notifications/" + notification.id, type: "PUT", - success: function() { - Diaspora.page.header.notifications.decrementCount(); - } + data: { unread: false }, + success: Diaspora.page.header.notifications.clickSuccess }); + } else { + notificationElement.addClass("read"); } }); });