From 2ec19df5db62b8aea17a6cc13d908f9b98099ef4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 13 Jan 2011 14:48:15 +0100 Subject: [PATCH] =?utf8?q?Small=20optimization=20to=20prevent=20loading=20?= =?utf8?q?of=20a=20post=20if=20it=E2=80=99s=20obviously=20not=20necessary.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/javascript/sone.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 9aa0b82..ccf7149 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -700,6 +700,9 @@ function loadNewPost(postId) { if (hasPost(postId)) { return; } + if (!isIndexPage() && (!isViewPostPage() || (getShownPostId() != postId))) { + return; + } $.getJSON("getPost.ajax", { "post" : postId }, function(data, textStatus) { if ((data != null) && data.success) { if (hasPost(data.post.id)) { -- 2.7.4