From: David ‘Bombe’ Roden Date: Thu, 25 Nov 2010 12:01:29 +0000 (+0100) Subject: Iterate over all post elements, regardless of their container. X-Git-Tag: 0.3.1-RC1~16 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=16b4eac4cee04086b91cf5cad580a6f2f69a194b;p=Sone.git Iterate over all post elements, regardless of their container. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 8a64118..6ef3e20 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -598,7 +598,7 @@ function loadNewPost(postId) { $.getJSON("ajax/getPost.ajax", { "post" : postId }, function(data, textStatus) { if ((data != null) && data.success) { var firstOlderPost = null; - $("#sone #posts .post").each(function() { + $("#sone .post").each(function() { if (getPostTime(this) < data.post.time) { firstOlderPost = $(this); return false; @@ -608,7 +608,7 @@ function loadNewPost(postId) { if (firstOlderPost != null) { newPost.insertBefore(firstOlderPost); } else { - $("#sone #posts .post:last").after(newPost); + $("#sone #posts").append(newPost); } ajaxifyPost(newPost); newPost.slideDown();