Fix comment being missing when clone is made when comment is in catalog thread.

Fixes bug from e45eaea49f775bcb59727e9657e718ac3dcd5421.
This commit is contained in:
ccd0 2016-09-22 07:30:10 -07:00
parent 9b33834bfc
commit ecec1211ab

View File

@ -7,10 +7,14 @@ Post.Clone = class extends Post
@[key] = @origin[key]
{nodes} = @origin
root = if contractThumb
@cloneWithoutVideo nodes.root
cloneNode = if contractThumb
@cloneWithoutVideo
else
nodes.root.cloneNode true
(node) -> node.cloneNode true
root = cloneNode nodes.root
# Handle case where comment has been moved into catalog thread
if nodes.comment.parentNode isnt nodes.post
$.add $('.post', root), cloneNode(nodes.comment)
Post.Clone.prefix or= 0
for node in [root, $$('[id]', root)...]
node.id = Post.Clone.prefix + node.id