Only insert posts when on the index or an appropriate “view Sone” page.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 26 Nov 2010 23:07:10 +0000 (00:07 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 26 Nov 2010 23:07:10 +0000 (00:07 +0100)
src/main/resources/static/javascript/sone.js

index cb16e64..f3ea9e8 100644 (file)
@@ -650,6 +650,9 @@ function loadNewPost(postId) {
        loadedPosts[postId] = true;
        $.getJSON("ajax/getPost.ajax", { "post" : postId }, function(data, textStatus) {
                if ((data != null) && data.success) {
+                       if (!isIndexPage() && !(isViewSonePage() && (getSoneId() == data.post.sone))) {
+                               return;
+                       }
                        var firstOlderPost = null;
                        $("#sone .post").each(function() {
                                if (getPostTime(this) < data.post.time) {