]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/4789'
authorTom Hughes <tom@compton.nu>
Wed, 5 Mar 2025 18:17:27 +0000 (18:17 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 5 Mar 2025 18:17:27 +0000 (18:17 +0000)
app/assets/javascripts/index.js
app/views/changesets/show.html.erb

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;
index 70b1877b5a0bb4789001e5d2ef9ebdb4a470f502..3f1aeb2017b6e00d1bd479abbb104d4236ca144c 100644 (file)
                              :data => { :method => comment.visible ? "DELETE" : "POST",
                                         :url => api_changeset_comment_visibility_path(comment) } %>
             <% end %>
+            <a href="#c<%= comment.id %>">
+              <svg width="16" height="16" fill="currentColor">
+                <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z" />
+                <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243z" />
+              </svg>
+            </a>
           </small>
           <div class="mx-2">
             <%= comment.body.to_html %>