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