X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=b3b8fdc160677c4beb7f8f25ff5f4e6e20fa91e5;hb=cb4a9b2d8e858faa618ffa9d6a032d1ac5f23d8d;hp=b44f19e2822e6cf498f1ec1b53b1baf95b37d52b;hpb=1a7c78f5bf78ad39d3b3c8c32a87749750cae14b;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index b44f19e..b3b8fdc 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -534,7 +534,7 @@ function ajaxifyReply(replyElement) { /* mark post and all replies as known on click. */ $(replyElement).click(function() { - markPostAsKnown(getPostElement(replyElement)); + markPostAsKnown(getPostElement(this)); }); } @@ -678,11 +678,11 @@ function loadNewPost(postId) { return; } $.getJSON("getPost.ajax", { "post" : postId }, function(data, textStatus) { - if (postId in loadedPosts) { - return; - } - loadedPosts[postId] = true; if ((data != null) && data.success) { + if (data.post.id in loadedPosts) { + return; + } + loadedPosts[data.post.id] = true; if (!isIndexPage() && !(isViewSonePage() && ((getShownSoneId() == data.post.sone) || (getShownSoneId() == data.post.recipient)))) { return; } @@ -711,12 +711,12 @@ function loadNewReply(replyId) { return; } $.getJSON("getReply.ajax", { "reply": replyId }, function(data, textStatus) { - if (replyId in loadedReplies) { - return; - } - loadedReplies[replyId] = true; /* find post. */ if ((data != null) && data.success) { + if (data.reply.id in loadedReplies) { + return; + } + loadedReplies[data.reply.id] = true; $("#sone .post#" + data.reply.postId).each(function() { var firstNewerReply = null; $(this).find(".replies .reply").each(function() {