Mark elements as known when a notification is removed.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 7 Apr 2011 09:26:24 +0000 (11:26 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 7 Apr 2011 09:26:24 +0000 (11:26 +0200)
src/main/resources/static/javascript/sone.js

index 1c0ac1c..21f6803 100644 (file)
@@ -981,6 +981,22 @@ function getStatus() {
                                        }
                                });
                                if (!foundNotification) {
+                                       if (notificationId == "new-sone-notification") {
+                                               $(".sone-id", this).each(function(index, element) {
+                                                       soneId = $(this).text();
+                                                       markSoneAsKnown(getSone(soneId), true);
+                                               });
+                                       } else if (notificationId == "new-post-notification") {
+                                               $(".post-id", this).each(function(index, element) {
+                                                       postId = $(this).text();
+                                                       markPostAsKnown(getPost(postId), true);
+                                               });
+                                       } else if (notificationId == "new-replies-notification") {
+                                               $(".reply-id", this).each(function(index, element) {
+                                                       replyId = $(this).text();
+                                                       markReplyAsKnown(getReply(replyId), true);
+                                               });
+                                       }
                                        $(this).slideUp("normal", function() {
                                                $(this).remove();
                                        });