diff --git a/boards/static/js/thread.js b/boards/static/js/thread.js --- a/boards/static/js/thread.js +++ b/boards/static/js/thread.js @@ -138,12 +138,16 @@ function showQuoteButton() { var rect = window.getSelection().getRangeAt(0).getBoundingClientRect(); var element = $(document.elementFromPoint(rect.x, rect.y)); - var postParent = element.parents('.post'); - if (postParent.length > 0) { - quoteButton.attr('data-post-id', postParent.attr('id')); + var postId = null; + if (element.hasClass('post')) { + postId = element.attr('id'); } else { - quoteButton.attr('data-post-id', null); + var postParent = element.parents('.post'); + if (postParent.length > 0) { + postId = postParent.attr('id'); + } } + quoteButton.attr('data-post-id', postId); } else { quoteButton.hide(); }