<p></p>
<p><b>@AntonKhorev</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6127#discussion_r2178768603">app/assets/javascripts/index/element.js</a>:</p>
<pre style='color:#555'>> +      $("#sidebar_content").on("click", "a.wdt-preview", e => {
+        e.preventDefault();
+        previewWikidataValue($(e.currentTarget));
+      });
</pre>
<ol dir="auto">
<li>Open any element page with wikidata.</li>
<li>Close the sidebar.</li>
<li>Press <em>back</em> to reopen the element page.</li>
<li>Click the <em>wikidata</em> button.</li>
</ol>
<p dir="auto">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 <code class="notranslate">.on("click", "a[href='#versions-navigation-active-page-item']", ...)</code> outside of <code class="notranslate">OSM.Element</code>, <code class="notranslate">.on()</code> runs only once there. <code class="notranslate">abortController</code> 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.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6127#pullrequestreview-2977287263">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLNXHATQID2BS5H2VL3GMSW7AVCNFSM6AAAAAB75WISWSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDSNZXGI4DOMRWGM">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLP4H4O62MKI6WE7OGD3GMSW7A5CNFSM6AAAAAB75WISWSWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTVROXGF6.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/6127/review/2977287263</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/6127#pullrequestreview-2977287263",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6127#pullrequestreview-2977287263",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>