summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/Headlines.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/Headlines.js b/js/Headlines.js
index b10680cfe..128a7e571 100755
--- a/js/Headlines.js
+++ b/js/Headlines.js
@@ -929,14 +929,18 @@ const Headlines = {
} else if (App.isCombinedMode()) {
// try to show hsp if no next article exists, in case there's useful information like first_id_changed etc
const row = $("RROW-" + current_id);
+ const ctr = $("headlines-frame");
if (row) {
const next = row.nextSibling;
// hsp has half-screen height in auto catchup mode therefore we use its first child (normally A element)
if (next && Element.visible(next) && next.id == "headlines-spacer" && next.firstChild) {
- $("headlines-frame").scrollTop = $("headlines-spacer").offsetTop -
- $("headlines-frame").offsetHeight + next.firstChild.offsetHeight;
+ const offset = $("headlines-spacer").offsetTop - $("headlines-frame").offsetHeight + next.firstChild.offsetHeight;
+
+ // don't jump back either
+ if (ctr.scrollTop < offset)
+ ctr.scrollTop = offset;
}
}
}