Don’t show “comment” link if there’s no reply form (i.e. if not logged in).
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 16 Jan 2011 14:05:47 +0000 (15:05 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 16 Jan 2011 14:05:47 +0000 (15:05 +0100)
src/main/resources/static/javascript/sone.js

index e0c8162..7fe842b 100644 (file)
@@ -65,7 +65,7 @@ function registerInputTextareaSwap(inputElement, defaultText, inputFieldName, op
  *            The element to add a “comment” link to
  */
 function addCommentLink(postId, element, insertAfterThisElement) {
-       if ($(element).find(".show-reply-form").length > 0) {
+       if (($(element).find(".show-reply-form").length > 0) || (getPostElement(element).find(".create-reply").length == 0)) {
                return;
        }
        commentElement = (function(postId) {