From edd7e14cf3bd175235c956219b23b0906395fda9 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 27 Jan 2017 18:27:34 -0800 Subject: [PATCH] If `Quote Preview` is enabled, links to threads in the internal archive will show previews of the OP on hover, as the native extension does. #1256 --- src/Quotelinks/QuotePreview.coffee | 9 ++++++++- src/classes/Fetcher.coffee | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Quotelinks/QuotePreview.coffee b/src/Quotelinks/QuotePreview.coffee index d06a99114..ff63a9277 100644 --- a/src/Quotelinks/QuotePreview.coffee +++ b/src/Quotelinks/QuotePreview.coffee @@ -1,6 +1,13 @@ QuotePreview = init: -> - return unless g.VIEW in ['index', 'thread'] and Conf['Quote Previewing'] + return unless Conf['Quote Previewing'] + + if g.VIEW is 'archive' + $.on d, 'mouseover', (e) -> + if e.target.nodeName is 'A' and $.hasClass(e.target, 'quotelink') + QuotePreview.mouseover.call e.target, e + + return unless g.VIEW in ['index', 'thread'] if Conf['Comment Expansion'] ExpandComment.callbacks.push @node diff --git a/src/classes/Fetcher.coffee b/src/classes/Fetcher.coffee index 3537c16e9..45779c33a 100644 --- a/src/classes/Fetcher.coffee +++ b/src/classes/Fetcher.coffee @@ -14,6 +14,7 @@ class Fetcher insert: (post) -> # Stop here if the container has been removed while loading. return unless @root.parentNode + @quoter or= post clone = post.addClone @quoter.context, ($.hasClass @root, 'dialog') Main.callbackNodes 'Post', [clone]