From: David ‘Bombe’ Roden Date: Thu, 13 Jan 2011 13:48:15 +0000 (+0100) Subject: Small optimization to prevent loading of a post if it’s obviously not necessary. X-Git-Tag: 0.3.7^2~5^2~7 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=2ec19df5db62b8aea17a6cc13d908f9b98099ef4 Small optimization to prevent loading of a post if it’s obviously not necessary. --- 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)) {