[openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)

Anton Khorev notifications at github.com
Wed Jul 2 00:38:07 UTC 2025


@AntonKhorev commented on this pull request.



> +      $("#sidebar_content").on("click", "a.wdt-preview", e => {
+        e.preventDefault();
+        previewWikidataValue($(e.currentTarget));
+      });

1. Open any element page with wikidata.
2. Close the sidebar.
3. Press *back* to reopen the element page.
4. Click the *wikidata* button.

You'll see two wikidata rows added. That's because the click listener is installed twice, and you can repeat the procedure for more installs. This is why I install `.on("click", "a[href='#versions-navigation-active-page-item']", ...)` outside of `OSM.Element`, `.on()` runs only once there. `abortController` will also need to be moved out in this case, which should work fine because we have at most only one sidebar content running at the same time.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6127/review/2977287263 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250701/35d62410/attachment.htm>


More information about the rails-dev mailing list