From: David ‘Bombe’ Roden Date: Mon, 18 Oct 2010 07:52:18 +0000 (+0200) Subject: Hide reply creation input text fields until “comment” link is clicked. X-Git-Tag: 0.1-RC1~252 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=097bb365454bb0471463fc610621deac63679884;p=Sone.git Hide reply creation input text fields until “comment” link is clicked. --- diff --git a/src/main/resources/templates/include/viewPost.html b/src/main/resources/templates/include/viewPost.html index 00ee653..74fe29a 100644 --- a/src/main/resources/templates/include/viewPost.html +++ b/src/main/resources/templates/include/viewPost.html @@ -1,4 +1,4 @@ -
+
<% post.text|html>
@@ -20,7 +20,7 @@
<%/foreach> -
+
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 2b21e91..8cbf77e 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -7,10 +7,16 @@ registerInputTextareaSwap("#sone input.create-reply", "Write a Reply…"); /* hide all the “create reply” forms until a link is clicked. */ - commentElement = $("
Comment
").addClass("show-reply-form").click(function() { + $("#sone .post").each(function() { + postId = $(this).attr("id"); + (function(postId) { + commentElement = $("
Comment
").addClass("show-reply-form").click(function() { + $("#sone .post#" + postId + " .create-reply").removeClass("hidden"); + }); + })(postId); + $(this).find(".create-reply").addClass("hidden"); + $(this).find(".status-line .time").after(commentElement); }); - $("#sone .post > .status-line .time").after(commentElement); - $("#sone .post .create-reply").addClass("hidden"); });