ReplyPruning: Don't hide linked-to posts in the first place, and don't hide when opening thread by OP link.

This commit is contained in:
ccd0 2016-04-03 23:44:06 -07:00
parent 185bfb2102
commit c473e01638

View File

@ -62,6 +62,15 @@ ReplyPruning =
ReplyPruning.total++
ReplyPruning.totalFiles++ if post.file
# If we're linked to a post that we would hide, don't hide the posts in the first place.
# Also don't hide posts if we open the thread by a link to the OP.
if (
ReplyPruning.active and
/^#p\d+$/.test(location.hash) and
0 <= @posts.keys.indexOf(location.hash[2..]) < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0)
)
ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false
$.after @OP.nodes.root, ReplyPruning.summary
$.on ReplyPruning.inputs.enabled, 'change', ReplyPruning.update