Mark a post as known when liking or unliking the post or own of its replies.
[Sone.git] / 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) {