]> git.openstreetmap.org Git - rails.git/commitdiff
Prevent changeset comment links from reloading the page
authorAnton Khorev <tony29@yandex.ru>
Wed, 5 Mar 2025 15:09:29 +0000 (18:09 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 5 Mar 2025 15:10:30 +0000 (18:10 +0300)
app/assets/javascripts/index.js

index c5bddbaec058a714d2f01ded486cee431a3a1955..cbb6afafe428bc5f645095f13d3295b087a03d52 100644 (file)
@@ -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;