From 75a01d21850fc2c9a7096a948545622a7c2a65eb Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 20 Apr 2016 08:27:30 -0700 Subject: [PATCH] Stop Reply Pruning from making the thread scroll as it removes posts. --- src/Monitoring/ReplyPruning.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Monitoring/ReplyPruning.coffee b/src/Monitoring/ReplyPruning.coffee index 1cf4199fa..a91521235 100644 --- a/src/Monitoring/ReplyPruning.coffee +++ b/src/Monitoring/ReplyPruning.coffee @@ -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