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