[openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
Anton Khorev
notifications at github.com
Mon Jun 30 14:16:41 UTC 2025
@AntonKhorev commented on this pull request.
> + $("#sidebar-content").on("turbo:before-stream-render", event => {
+ const defaultRender = event.detail.render;
+ event.detail.render = function (streamElement) {
+ defaultRender(streamElement);
+ markWikidataLinksAsExplainable();
+ };
+ });
I wouldn't say it rewrites the tag value. I think it's obvious what is a tag value and what is an icon on the side of the table cell, because tag values are text and not images. Previously you changed the text.
If you install the listener like this
https://github.com/openstreetmap/openstreetmap-website/blob/3aebcb18fdf437b6994866fc66120f48e37f0cd2/app/assets/javascripts/index/element.js#L2
the selection for whatever you write after `"click"` will happen inside the listener on `document`. Turbo stream is not rewriting the entire document killing off that listener. Although maybe `#sidebar` would have been better than `document` in this case, turbo stream doesn't rewrite it either.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6127#discussion_r2175188539
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6127/review/2971417114 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250630/1a08f973/attachment.htm>
More information about the rails-dev
mailing list