Fix navigating between threads via quote hashes (Navigate.coffee part of d2511776419976b0496d1889d697fc86e4bd26fd)
This commit is contained in:
parent
65671b2e2a
commit
b29bee8869
@ -22,17 +22,18 @@ Navigate =
|
|||||||
replyLink = $ 'a.replylink', @OP.nodes.info
|
replyLink = $ 'a.replylink', @OP.nodes.info
|
||||||
$.on replyLink, 'click', Navigate.navigate
|
$.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
|
# We don't need to reload the thread inside the thread
|
||||||
return if g.VIEW is 'thread' and @thread.ID is g.THREADID
|
return if g.VIEW is 'thread' and @thread.ID is g.THREADID
|
||||||
postlink = $ 'a[title="Link to this post"]', @nodes.info
|
postlink = $ 'a[title="Link to this post"]', @nodes.info
|
||||||
$.on postlink, 'click', Navigate.navigate
|
$.on postlink, 'click', Navigate.navigate
|
||||||
|
|
||||||
return unless Conf['Quote Hash Navigation']
|
|
||||||
for hashlink in $$ '.hashlink', @nodes.comment
|
|
||||||
$.on hashlink, 'click', Navigate.navigate
|
|
||||||
return
|
|
||||||
|
|
||||||
clean: ->
|
clean: ->
|
||||||
# Garbage collection
|
# Garbage collection
|
||||||
g.threads.forEach (thread) -> thread.collect()
|
g.threads.forEach (thread) -> thread.collect()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user