[openstreetmap/openstreetmap-website] Scrollable pagination javascript module (PR #6304)

Holger Jeromin notifications at github.com
Sat Aug 9 01:19:11 UTC 2025


@HolgerJeromin commented on this pull request.



> +  $(document).on("numbered_pagination:enable", function () {
+    shadowEffect = new ShadowEffect();
+    $(document).trigger("numbered_pagination:center");
+  });
+
+  $(document).on("numbered_pagination:disable", function () {
+    shadowEffect?.disable();
+    shadowEffect = null;
+  });
+
+  $(document).on("numbered_pagination:center", function () {
+    const [scrollableList] = $("#versions-navigation-list-middle");
+
+    if (!scrollableList) return;
+
+    const [activeStartItem] = $("#versions-navigation-list-start #versions-navigation-active-page-item");

As you are working on a DOM element (and not jquery collections) I would go with this

```suggestion
    const activeStartItem = document.querySelector("#versions-navigation-list-start #versions-navigation-active-page-item");
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6304#pullrequestreview-3102368086
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6304/review/3102368086 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250808/49fc0148/attachment.htm>


More information about the rails-dev mailing list