Iterate over all post elements, regardless of their container.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 25 Nov 2010 12:01:29 +0000 (13:01 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 25 Nov 2010 12:01:29 +0000 (13:01 +0100)
src/main/resources/static/javascript/sone.js

index 8a64118..6ef3e20 100644 (file)
@@ -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();