]> git.openstreetmap.org Git - rails.git/commitdiff
Add aria-label to close buttons
authorAnton Khorev <tony29@yandex.ru>
Mon, 31 Oct 2022 20:54:58 +0000 (23:54 +0300)
committerAnton Khorev <tony29@yandex.ru>
Mon, 31 Oct 2022 20:54:58 +0000 (23:54 +0300)
app/assets/javascripts/index/browse.js
app/assets/javascripts/index/directions.js
app/views/application/_sidebar_header.html.erb
app/views/layouts/_banner.html.erb
app/views/layouts/_search.html.erb

index 9d3f9a470afcac161e55faaa894fa26faad37d98..a65934d0227c3f53eee00c23e2e97d63d6628ce4 100644 (file)
@@ -54,6 +54,7 @@ OSM.initializeBrowse = function (map) {
             .text(I18n.t("browse.start_rjs.load_data")),
           $("<div>").append(
             $("<button type='button' class='btn-close'>")
+              .attr("aria-label", I18n.t("javascripts.close"))
               .click(cancel))),
         $("<p class='alert alert-warning'>")
           .text(I18n.t("browse.start_rjs.feature_warning", { num_features: count, max_features: limit })),
index 500610e26dfc9c4f3ed3529614f60c54a05a0757..75c647802b7a4ff42f3143a0e93f3ae3f535fdb3 100644 (file)
@@ -265,7 +265,8 @@ OSM.Directions = function (map) {
       }
 
       var turnByTurnTable = $("<table class='mb-3'>");
-      var directionsCloseButton = $("<button type='button' class='btn-close'>");
+      var directionsCloseButton = $("<button type='button' class='btn-close'>")
+        .attr("aria-label", I18n.t("javascripts.close"));
 
       $("#sidebar_content")
         .empty()
index 868442c3ed8cbaf9fa209341c03269c71ba775f1..88a1fff4ab631fb5d915185fb4a3b51e6ca3ac4e 100644 (file)
@@ -1,6 +1,6 @@
 <div class="d-flex w-100">
   <h2 class="flex-grow-1 text-break"><%= title %></h2>
   <div>
-    <button type="button" class="btn-close"></button>
+    <button type="button" class="btn-close" aria-label="<%= t("javascripts.close") %>"></button>
   </div>
 </div>
index 2751a545816f58a81cff1864b34497b33c04296c..f806201eb8ff929eedc11585370ff904c42c3ecf 100644 (file)
@@ -1,4 +1,4 @@
 <% unless (banner = next_banner()).nil? %>
 <%= link_to (image_tag banner[:img], :alt => banner[:alt], :title => banner[:alt]), banner[:link] %>
-<button type="button" class="btn-close position-absolute top-0 end-0 p-4" id="<%= banner_cookie(banner[:id]) %>"></button>
+<button type="button" class="btn-close position-absolute top-0 end-0 p-4" id="<%= banner_cookie(banner[:id]) %>" aria-label="<%= t("javascripts.close") %>"></button>
 <% end %>
index 9ce1265b412828f45040be2f7d8ad9b6c988d3bf..e7cae0471c9d58c8ebc566e5aecba16765eb405b 100644 (file)
@@ -19,7 +19,7 @@
   </form>
 
   <form method="GET" action="<%= directions_path %>" class="directions_form pb-3">
-    <div class="d-flex flex-row-reverse px-3 py-3"><button type="button" class="btn-close"></button></div>
+    <div class="d-flex flex-row-reverse px-3 py-3"><button type="button" class="btn-close" aria-label="<%= t("javascripts.close") %>"></button></div>
 
     <div class="row gx-2 m-1">
       <div class="col-1">