When expanding threads, rebuild posts originally fetched for quote previews.

Fixes lack of post hiding buttons etc.
This commit is contained in:
ccd0 2015-02-08 00:27:49 -08:00
parent 52a5d1bd45
commit 184141a5e0
4 changed files with 7 additions and 3 deletions

View File

@ -89,6 +89,10 @@ class Post
@isHidden = false
@clones = []
if g.posts[@fullID]
@isRebuilt = true
@clones = g.posts[@fullID].clones
clone.origin = @ for clone in @clones
g.posts.push @fullID, thread.posts.push @, board.posts.push @, @
@kill() if that.isArchived

View File

@ -157,7 +157,7 @@ Embedding =
link.textContent = text
for post2 in post.clones
for link2 in $$ 'a.linkify', post2.nodes.comment when link2.href is link.href
link2.dataset.original = link2.textContent
link2.dataset.original ?= link2.textContent
link2.textContent = text
return

View File

@ -90,7 +90,7 @@ ExpandThread =
filesCount = 0
for postData in req.response.posts
continue if postData.no is thread.ID
if post = thread.posts[postData.no]
if (post = thread.posts[postData.no]) and not post.isFetchedQuote
filesCount++ if 'file' of post
postsRoot.push post.nodes.root
continue

View File

@ -21,7 +21,7 @@ QuoteBacklink =
name: 'Quote Backlinking Part 2'
cb: @secondNode
firstNode: ->
return if @isClone or !@quotes.length
return if @isClone or !@quotes.length or @isRebuilt
markYours = Conf['Quick Reply'] and Conf['Mark Quotes of You'] and QR.db.get {boardID: @board.ID, threadID: @thread.ID, postID: @ID}
a = $.el 'a',
href: Build.postURL @board.ID, @thread.ID, @ID