From 28ab2bd3f3e4991d09682649e6b0456e6acfe016 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 27 Nov 2010 01:04:46 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20hide=20replies=20on=20=E2=80=9Cv?= =?utf8?q?iew=20post=E2=80=9D=20pages.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/javascript/sone.js | 46 +++++++++++++++------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index fa2b1cf..bded3ce 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -828,30 +828,32 @@ $(document).ready(function() { }); /* hides all replies but the latest two. */ - getTranslation("WebInterface.ClickToShow.Replies", function(text) { - $("#sone .post .replies").each(function() { - allReplies = $(this).find(".reply"); - if (allReplies.length > 2) { - newHidden = false; - for (replyIndex = 0; replyIndex < (allReplies.length - 2); ++replyIndex) { - $(allReplies[replyIndex]).addClass("hidden"); - newHidden |= $(allReplies[replyIndex]).hasClass("new"); - } - clickToShowElement = $("
").addClass("click-to-show"); - if (newHidden) { - clickToShowElement.addClass("new"); + if (!isViewPostPage()) { + getTranslation("WebInterface.ClickToShow.Replies", function(text) { + $("#sone .post .replies").each(function() { + allReplies = $(this).find(".reply"); + if (allReplies.length > 2) { + newHidden = false; + for (replyIndex = 0; replyIndex < (allReplies.length - 2); ++replyIndex) { + $(allReplies[replyIndex]).addClass("hidden"); + newHidden |= $(allReplies[replyIndex]).hasClass("new"); + } + clickToShowElement = $("
").addClass("click-to-show"); + if (newHidden) { + clickToShowElement.addClass("new"); + } + (function(clickToShowElement, allReplies, text) { + clickToShowElement.text(text); + clickToShowElement.click(function() { + allReplies.removeClass("hidden"); + clickToShowElement.addClass("hidden"); + }); + })(clickToShowElement, allReplies, text); + $(allReplies[0]).before(clickToShowElement); } - (function(clickToShowElement, allReplies, text) { - clickToShowElement.text(text); - clickToShowElement.click(function() { - allReplies.removeClass("hidden"); - clickToShowElement.addClass("hidden"); - }); - })(clickToShowElement, allReplies, text); - $(allReplies[0]).before(clickToShowElement); - } + }); }); - }); + } /* * convert all “follow”, “unfollow”, “lock”, and “unlock” links to something -- 2.7.4