From 46ad26b66e978c531f563a51a4ff6a2908816947 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 25 Nov 2010 20:50:37 +0100 Subject: [PATCH] =?utf8?q?Add=20element=20after=20which=20the=20=E2=80=9Cc?= =?utf8?q?omment=E2=80=9D=20link=20is=20to=20be=20inserted=20to=20the=20pa?= =?utf8?q?rameters.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/javascript/sone.js | 8 +++----- src/main/resources/templates/include/viewPost.html | 2 +- src/main/resources/templates/include/viewReply.html | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 39999e9..f195d59 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -63,7 +63,7 @@ function registerInputTextareaSwap(inputElement, defaultText, inputFieldName, op * @param element * The element to add a “comment” link to */ -function addCommentLink(postId, element) { +function addCommentLink(postId, element, insertAfterThisElement) { if ($(element).find(".show-reply-form").length > 0) { return; } @@ -86,9 +86,7 @@ function addCommentLink(postId, element) { }); return commentElement; })(postId); - $(element).find(".status-line .time").each(function() { - $(this).after(commentElement.clone(true)); - }); + $(insertAfterThisElement).after(commentElement.clone(true)); } var translations = {}; @@ -527,7 +525,7 @@ function ajaxifyReply(replyElement) { }); }); })(replyElement); - addCommentLink(getPostId(replyElement), replyElement); + addCommentLink(getPostId(replyElement), replyElement, $(replyElement).find(".reply-status-line .time")); } /** diff --git a/src/main/resources/templates/include/viewPost.html b/src/main/resources/templates/include/viewPost.html index 452513b..e351fd0 100644 --- a/src/main/resources/templates/include/viewPost.html +++ b/src/main/resources/templates/include/viewPost.html @@ -9,7 +9,7 @@
<% post.text|html>
-
+
⬆
<%ifnull ! currentSone> diff --git a/src/main/resources/templates/include/viewReply.html b/src/main/resources/templates/include/viewReply.html index d0a7842..d77625b 100644 --- a/src/main/resources/templates/include/viewReply.html +++ b/src/main/resources/templates/include/viewReply.html @@ -9,7 +9,7 @@
<% reply.text|html>
-
+
<% reply.time|date format="MMM d, yyyy, HH:mm:ss">
⬆
<%ifnull ! currentSone> -- 2.7.4