From: David ‘Bombe’ Roden Date: Thu, 25 Nov 2010 19:50:37 +0000 (+0100) Subject: Add element after which the “comment” link is to be inserted to the parameters. X-Git-Tag: 0.3.1-RC2~7 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=46ad26b66e978c531f563a51a4ff6a2908816947 Add element after which the “comment” link is to be inserted to the parameters. --- 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>