]> git.openstreetmap.org Git - rails.git/commit
Fix marking changesets outside of viewport on history pages
authorAnton Khorev <tony29@yandex.ru>
Wed, 16 Apr 2025 10:53:06 +0000 (13:53 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 16 Apr 2025 11:26:43 +0000 (14:26 +0300)
commit0a9cd466c7fe3b1b34566c051d6b6cb5e811e9c5
tree01227d68b248ef35dacb7cdcefbaeb9f5f3d4e02
parent1efa0a1f99bc86bcd7a7977edbe85a6c3dd3d064
Fix marking changesets outside of viewport on history pages

The previous method relied on intersection events for all changeset list items that go from below the viewport to above the viewport or in the opposite direction. But that required the items to enter the viewport in between. This is not guaranteed to happen if the sidebar contents is scrolled fast enough, for example by dragging the scrollbar or pressing Home/End keys. If an item goes from below straight to above without ever being inside the viewport, no intersection event is generated and the changeset is left in an invalid state with wrong color.

This fix updates changesets below/above based on changesets inside the viewport.
app/assets/javascripts/index/history-changesets-layer.js
app/assets/javascripts/index/history.js