Don’t show “comment” link if there’s no reply form (i.e. if not logged in).
[Sone.git] / 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) {