Mark a post as known when liking or unliking the post or own of its replies.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 25 Nov 2010 14:03:59 +0000 (15:03 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 25 Nov 2010 14:03:59 +0000 (15:03 +0100)
src/main/resources/static/javascript/sone.js

index d5c4461..32ad683 100644 (file)
@@ -475,10 +475,12 @@ function ajaxifyPost(postElement) {
        /* convert all “like” buttons to javascript functions. */
        $(postElement).find(".like-post").submit(function() {
                likePost(getPostId(this));
+               markPostAsKnown(getPostElement(this));
                return false;
        });
        $(postElement).find(".unlike-post").submit(function() {
                unlikePost(getPostId(this));
+               markPostAsKnown(getPostElement(this));
                return false;
        });
 
@@ -511,10 +513,12 @@ function ajaxifyPost(postElement) {
 function ajaxifyReply(replyElement) {
        $(replyElement).find(".like-reply").submit(function() {
                likeReply(getReplyId(this));
+               markPostAsKnown(getPostElement(this));
                return false;
        });
        $(replyElement).find(".unlike-reply").submit(function() {
                unlikeReply(getReplyId(this));
+               markPostAsKnown(getPostElement(this));
                return false;
        });
        (function(replyElement) {