From 184141a5e0c5c1da2ac85c8d0c550bfb24b02577 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 8 Feb 2015 00:27:49 -0800 Subject: [PATCH] When expanding threads, rebuild posts originally fetched for quote previews. Fixes lack of post hiding buttons etc. --- src/General/lib/post.class | 4 ++++ src/Linkification/Embedding.coffee | 2 +- src/Miscellaneous/ExpandThread.coffee | 2 +- src/Quotelinks/QuoteBacklink.coffee | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/General/lib/post.class b/src/General/lib/post.class index 063cb9090..e9146754d 100755 --- a/src/General/lib/post.class +++ b/src/General/lib/post.class @@ -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 diff --git a/src/Linkification/Embedding.coffee b/src/Linkification/Embedding.coffee index 1549f4d05..43e7ce041 100644 --- a/src/Linkification/Embedding.coffee +++ b/src/Linkification/Embedding.coffee @@ -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 diff --git a/src/Miscellaneous/ExpandThread.coffee b/src/Miscellaneous/ExpandThread.coffee index 87e219421..c0d0a3206 100755 --- a/src/Miscellaneous/ExpandThread.coffee +++ b/src/Miscellaneous/ExpandThread.coffee @@ -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 diff --git a/src/Quotelinks/QuoteBacklink.coffee b/src/Quotelinks/QuoteBacklink.coffee index 028bb2694..3c6fada31 100755 --- a/src/Quotelinks/QuoteBacklink.coffee +++ b/src/Quotelinks/QuoteBacklink.coffee @@ -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