add Headlines.default_move_on_expand tunable

This commit is contained in:
Andrew Dolgov 2023-04-13 20:15:23 +03:00
parent 1e90feef0e
commit 0578bf8025
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
1 changed files with 3 additions and 1 deletions

View File

@ -13,6 +13,7 @@ const Headlines = {
_scroll_reset_timeout: false, _scroll_reset_timeout: false,
default_force_previous: false, default_force_previous: false,
default_force_to_top: false, default_force_to_top: false,
default_move_on_expand: true,
line_scroll_offset: 120, /* px */ line_scroll_offset: 120, /* px */
sticky_header_observer: new IntersectionObserver( sticky_header_observer: new IntersectionObserver(
(entries, observer) => { (entries, observer) => {
@ -255,7 +256,8 @@ const Headlines = {
// this would only work if there's enough space // this would only work if there's enough space
App.byId("headlines-frame").scrollTop -= scroll_position_A-scroll_position_B; App.byId("headlines-frame").scrollTop -= scroll_position_A-scroll_position_B;
Article.cdmMoveToId(id); if (this.default_move_on_expand)
Article.cdmMoveToId(id);
} }
} else if (in_body) { } else if (in_body) {