@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/2971417...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to