]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Merge remote-tracking branch 'upstream/pull/5749'
[rails.git] / app / assets / javascripts / index.js
index 9888b3a7e5fc0abaefb76c141e289e1ce297f390..cbb6afafe428bc5f645095f13d3295b087a03d52 100644 (file)
@@ -24,7 +24,7 @@
 //= require index/home
 //= require router
 
 //= require index/home
 //= require router
 
-$(document).ready(function () {
+$(function () {
   const map = new L.OSM.Map("map", {
     zoomControl: false,
     layerControl: false,
   const map = new L.OSM.Map("map", {
     zoomControl: false,
     layerControl: false,
@@ -380,6 +380,11 @@ $(document).ready(function () {
       return;
     }
 
       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;
     // Ignore cross-protocol and cross-origin links.
     if (location.protocol !== this.protocol || location.host !== this.host) {
       return;