clicking on notifications takes note of the current UI state and makes sure that the resulting 'read' state matches the users expectation.
This commit is contained in:
parent
a7af886da2
commit
b6dd14a968
1 changed files with 11 additions and 4 deletions
|
|
@ -15,11 +15,18 @@
|
|||
notificationArea: notificationArea
|
||||
});
|
||||
|
||||
$(".stream_element.unread").live("mousedown", function() {
|
||||
self.decrementCount();
|
||||
|
||||
$(".stream_element.unread,.stream_element.read").live("mousedown", function() {
|
||||
if ( $(this).hasClass("unread") ) {
|
||||
self.decrementCount();
|
||||
$(this).removeClass("unread").addClass( "read" )
|
||||
}
|
||||
else {
|
||||
self.incrementCount();
|
||||
$(this).removeClass("read").addClass( "unread" )
|
||||
}
|
||||
$.ajax({
|
||||
url: "notifications/" + $(this).removeClass("unread").data("guid"),
|
||||
url: "notifications/" + $(this).data("guid"),
|
||||
data: { is_unread: $(this).hasClass("unread") },
|
||||
type: "PUT"
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue