notifications popup menu should use functions from regular notification object.
This commit is contained in:
parent
02531337cb
commit
95b553f953
1 changed files with 6 additions and 3 deletions
|
|
@ -63,6 +63,7 @@
|
|||
$.each(notifications, function(index, notification) {
|
||||
var notificationElement = $("<div/>")
|
||||
.addClass("notification_element")
|
||||
.data( "guid", notification.id )
|
||||
.html(notification.translation)
|
||||
.prepend($("<img/>", { src: notification.actors[0].avatar }))
|
||||
.append("<br />")
|
||||
|
|
@ -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");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue