From a4553f2bc41cda311e821ac3ddfc93b7269fabd1 Mon Sep 17 00:00:00 2001 From: Bauke Date: Fri, 5 Oct 2018 15:27:44 +0200 Subject: [PATCH] Check if reply comment box already exists --- tildes/static/js/behaviors/comment-reply-button.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tildes/static/js/behaviors/comment-reply-button.js b/tildes/static/js/behaviors/comment-reply-button.js index 016a0b9..0cd4cf2 100644 --- a/tildes/static/js/behaviors/comment-reply-button.js +++ b/tildes/static/js/behaviors/comment-reply-button.js @@ -25,6 +25,10 @@ $.onmount('[data-js-comment-reply-button]', function() { var postURL = '/api/web/comments/' + parentCommentID + '/replies'; var markdownID = 'markdown-reply-' + parentCommentID; + if ($('#' + markdownID).length) { + return; + } + var replyForm = document.createElement('form'); replyForm.setAttribute('method', 'post'); replyForm.setAttribute('autocomplete', 'off');