Navigate to stubbed threads. #1074

This commit is contained in:
Mayhem 2013-04-30 19:32:12 +02:00
parent a77f572c28
commit 363753fc19
4 changed files with 9 additions and 7 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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]

View File

@ -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