From: Anton Khorev Date: Wed, 5 Mar 2025 15:09:29 +0000 (+0300) Subject: Prevent changeset comment links from reloading the page X-Git-Tag: live~48^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/cf80eb50f3aa0f20052aa35768ef411907950533?ds=sidebyside;hp=--cc Prevent changeset comment links from reloading the page --- cf80eb50f3aa0f20052aa35768ef411907950533 diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index c5bddbaec..cbb6afafe 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -380,6 +380,11 @@ $(function () { return; } + // Open local anchor links as normal. + if ($(this).attr("href")?.startsWith("#")) { + return; + } + // Ignore cross-protocol and cross-origin links. if (location.protocol !== this.protocol || location.host !== this.host) { return;