[openstreetmap/openstreetmap-website] Remove jQuery throttle-debounce dependency (PR #6811)

Martin Raifer notifications at github.com
Wed Jun 17 20:44:27 UTC 2026


@tyrasd commented on this pull request.



> @@ -39,14 +38,17 @@ document.addEventListener("DOMContentLoaded", function () {
       parent.postMessage({ type, data }, location.origin);
     }
 
-    id.map().on("move.embed", window.Cowboy.throttle(250, function () {
-      if (id.inIntro()) return;
-      const zoom = ~~id.map().zoom(),
-            center = id.map().center(),
-            llz = { lon: center[0], lat: center[1], zoom: zoom };
+    id.map().on("move.embed-init", function () {
+      id.map().on("move.embed-init", null);

yeah, d3's [event handling](https://d3js.org/d3-selection/events) is pretty bare-bones, so you do have to do some stuff the manual way. :sweat_smile: 

> `id.ui().hash` isn't available

Hmm, sorry I didn't think about this when adding the event. As far as I can see, there's nothing speaking against making it available right after `.init()` is finished. Let's change this (probably has to wait for the next release v2.42, though)

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

Message ID: <openstreetmap/openstreetmap-website/pull/6811/review/4519478051 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260617/0dea89cf/attachment.htm>


More information about the rails-dev mailing list