Marks posts as known when clicking a new post or reply.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 26 Nov 2010 05:52:53 +0000 (06:52 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 26 Nov 2010 05:52:53 +0000 (06:52 +0100)
src/main/resources/static/javascript/sone.js

index e07c51e..4b60dd9 100644 (file)
@@ -608,7 +608,9 @@ function loadNewPost(postId) {
                                        return false;
                                }
                        });
-                       newPost = $(data.post.html).addClass("hidden");
+                       newPost = $(data.post.html).addClass("hidden").click(function() {
+                               markPostAsKnown(this);
+                       });
                        if (firstOlderPost != null) {
                                newPost.insertBefore(firstOlderPost);
                        } else {
@@ -637,7 +639,9 @@ function loadNewReply(replyId) {
                                                return false;
                                        }
                                });
-                               newReply = $(data.reply.html).addClass("hidden");
+                               newReply = $(data.reply.html).addClass("hidden").click(function() {
+                                       markPostAsKnown(getPostElement(this));
+                               });
                                if (firstNewerReply != null) {
                                        newReply.insertBefore(firstNewerReply);
                                } else {