Show More
@@ -138,12 +138,16 function showQuoteButton() { | |||||
138 |
|
138 | |||
139 | var rect = window.getSelection().getRangeAt(0).getBoundingClientRect(); |
|
139 | var rect = window.getSelection().getRangeAt(0).getBoundingClientRect(); | |
140 | var element = $(document.elementFromPoint(rect.x, rect.y)); |
|
140 | var element = $(document.elementFromPoint(rect.x, rect.y)); | |
|
141 | var postId = null; | |||
|
142 | if (element.hasClass('post')) { | |||
|
143 | postId = element.attr('id'); | |||
|
144 | } else { | |||
141 | var postParent = element.parents('.post'); |
|
145 | var postParent = element.parents('.post'); | |
142 | if (postParent.length > 0) { |
|
146 | if (postParent.length > 0) { | |
143 |
|
|
147 | postId = postParent.attr('id'); | |
144 | } else { |
|
|||
145 | quoteButton.attr('data-post-id', null); |
|
|||
146 | } |
|
148 | } | |
|
149 | } | |||
|
150 | quoteButton.attr('data-post-id', postId); | |||
147 | } else { |
|
151 | } else { | |
148 | quoteButton.hide(); |
|
152 | quoteButton.hide(); | |
149 | } |
|
153 | } |
General Comments 0
You need to be logged in to leave comments.
Login now