summaryrefslogtreecommitdiff
path: root/js/Headlines.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-18 15:38:26 +0300
committerAndrew Dolgov <[email protected]>2021-02-18 15:38:26 +0300
commit2c5927d8cdc6f16f8e8f86df201e625159e746ce (patch)
treef98b01132d16207cd094098ed964b4f6922123a7 /js/Headlines.js
parent2e4b4037870ae0d69bc7a945bc86424d4cc9c1d2 (diff)
rework previous to be less jumpy
Diffstat (limited to 'js/Headlines.js')
-rwxr-xr-xjs/Headlines.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/Headlines.js b/js/Headlines.js
index 16026f593..b10680cfe 100755
--- a/js/Headlines.js
+++ b/js/Headlines.js
@@ -931,10 +931,12 @@ const Headlines = {
const row = $("RROW-" + current_id);
if (row) {
- const sibling = row.nextSibling;
+ const next = row.nextSibling;
- if (sibling && Element.visible(sibling) && sibling.id == "headlines-spacer") {
- App.Scrollable.scrollTo(sibling, $("headlines-frame"));
+ // 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;
}
}
}