Navigate to stubbed threads. #1074
This commit is contained in:
parent
a77f572c28
commit
363753fc19
@ -551,9 +551,7 @@ a.hide-announcement {
|
||||
float: left;
|
||||
margin-right: 2px;
|
||||
}
|
||||
.stub ~ .sideArrows,
|
||||
.stub ~ .hide-reply-button,
|
||||
.stub ~ .post {
|
||||
.stub ~ * {
|
||||
display: none !important;
|
||||
}
|
||||
.stub input {
|
||||
|
||||
@ -128,10 +128,10 @@ ThreadHiding =
|
||||
return if thread.isHidden
|
||||
{OP} = thread
|
||||
threadRoot = OP.nodes.root.parentNode
|
||||
threadRoot.hidden = thread.isHidden = true
|
||||
thread.isHidden = true
|
||||
|
||||
unless makeStub
|
||||
threadRoot.nextElementSibling.hidden = true # <hr>
|
||||
threadRoot.hidden = threadRoot.nextElementSibling.hidden = true # <hr>
|
||||
return
|
||||
|
||||
numReplies = 0
|
||||
@ -152,7 +152,7 @@ ThreadHiding =
|
||||
$.add thread.stub, a
|
||||
if Conf['Menu']
|
||||
$.add thread.stub, [$.tn(' '), Menu.makeButton OP]
|
||||
$.before threadRoot, thread.stub
|
||||
$.prepend threadRoot, thread.stub
|
||||
|
||||
show: (thread) ->
|
||||
if thread.stub
|
||||
|
||||
@ -8,6 +8,8 @@ Get =
|
||||
if excerpt.length > 70
|
||||
excerpt = "#{excerpt[...67]}..."
|
||||
"/#{thread.board}/ - #{excerpt}"
|
||||
threadFromRoot: (root) ->
|
||||
g.threads["#{g.BOARD}.#{root.id[1..]}"]
|
||||
postFromRoot: (root) ->
|
||||
link = $ 'a[title="Highlight this post"]', root
|
||||
boardID = link.pathname.split('/')[1]
|
||||
|
||||
@ -44,7 +44,9 @@ Nav =
|
||||
else
|
||||
headRect = Header.toggle.getBoundingClientRect()
|
||||
topMargin = headRect.top + headRect.height
|
||||
threads = $$ '.thread:not([hidden])'
|
||||
threads = $$('.thread').filter (thread) ->
|
||||
thread = Get.threadFromRoot thread
|
||||
!(thread.isHidden and !thread.stub)
|
||||
for thread, i in threads
|
||||
rect = thread.getBoundingClientRect()
|
||||
if rect.bottom > topMargin # not scrolled past
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user