From b29bee88698ca2954f4f3b37f9e596dfaa5337c1 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Mon, 3 Mar 2014 00:32:27 -0700 Subject: [PATCH] Fix navigating between threads via quote hashes (Navigate.coffee part of d2511776419976b0496d1889d697fc86e4bd26fd) --- src/General/Navigate.coffee | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index ae8b9ecf4..8640075c6 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -22,17 +22,18 @@ Navigate = replyLink = $ 'a.replylink', @OP.nodes.info $.on replyLink, 'click', Navigate.navigate - post: -> + post: -> # Allows us to navigate via JSON from thread to thread by hashes and quote highlights. + if Conf['Quote Hash Navigation'] + for hashlink in $$ '.hashlink', @nodes.comment + {boardID, threadID, postID} = Get.postDataFromLink hashlink + if boardID isnt g.BOARD.ID or (threadID isnt g.THREADID) + $.on hashlink, 'click', Navigate.navigate + # We don't need to reload the thread inside the thread return if g.VIEW is 'thread' and @thread.ID is g.THREADID postlink = $ 'a[title="Link to this post"]', @nodes.info $.on postlink, 'click', Navigate.navigate - return unless Conf['Quote Hash Navigation'] - for hashlink in $$ '.hashlink', @nodes.comment - $.on hashlink, 'click', Navigate.navigate - return - clean: -> # Garbage collection g.threads.forEach (thread) -> thread.collect()