From cf80eb50f3aa0f20052aa35768ef411907950533 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Wed, 5 Mar 2025 18:09:29 +0300 Subject: [PATCH] Prevent changeset comment links from reloading the page --- app/assets/javascripts/index.js | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.39.5