diff options
author | Andrew Dolgov <[email protected]> | 2020-05-17 22:02:47 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-05-17 22:02:47 +0300 |
commit | 8dc6b48ebd73b865c18e261a28f0e97ad304a39b (patch) | |
tree | 11f09dc8d44c6684b4d6039e85ebc06717bd6d4d /js/Headlines.js | |
parent | 06d2c65193b8679a6a7afbcd342ced07c53a4268 (diff) |
Headlines.move: when going back to top of active article, use a smarter (?) offset calculation
Diffstat (limited to 'js/Headlines.js')
-rwxr-xr-x | js/Headlines.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/js/Headlines.js b/js/Headlines.js index 6b77472e3..ba0f565da 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -844,8 +844,9 @@ define(["dojo/_base/declare"], function (declare) { const row = $("RROW-" + current_id); const ctr = $("headlines-frame"); + const delta_px = Math.max(row.offsetTop, ctr.scrollTop) - Math.min(row.offsetTop, ctr.scrollTop); - if (row && Math.round(row.offsetTop) < Math.round(ctr.scrollTop)) { + if (row && delta_px > 16) { Article.setActive(current_id); Article.cdmMoveToId(current_id, {force: noscroll, event: event}); } else if (prev_id) { |