Stop Reply Pruning from making the thread scroll as it removes posts.

This commit is contained in:
ccd0 2016-04-20 08:27:30 -07:00
parent 28e1da9a39
commit 75a01d2185

View File

@ -93,6 +93,11 @@ ReplyPruning =
else
0
# Record position from bottom of document
oldPos = d.body.clientHeight - window.scrollY
# Prevent header menu from closing due to scroll
$.off d, 'scroll', Header.menu.close if Header.menu.menu
{posts} = ReplyPruning.thread
if ReplyPruning.hidden < hidden2
@ -120,4 +125,7 @@ ReplyPruning =
Build.summaryText '-', ReplyPruning.total, ReplyPruning.totalFiles
ReplyPruning.summary.hidden = (ReplyPruning.total <= +Conf["Max Replies"])
# Maintain position in thread when posts are added/removed above
window.scroll window.scrollX, Math.max(d.body.clientHeight - oldPos, window.scrollY + Header.getTopOf $('.board'))
return ReplyPruning