Skip to content

Commit

Permalink
Merge pull request #2625 from sul-dlss/2483-iiif-link
Browse files Browse the repository at this point in the history
make sure iiif drag and drop has aria-label
  • Loading branch information
jcoyne authored Nov 5, 2024
2 parents a28c737 + 307485c commit 05672a7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ def document_leaflet_map(document:, **)

##
# @param [String] manifest
def iiif_drag_n_drop(manifest, width: '40')
def iiif_drag_n_drop(manifest, width: '40', document: nil)
link_url = format Settings.iiif_dnd_base_url, query: { manifest: manifest }.to_query
link_to link_url, class: 'iiif-dnd float-right', data: { turbolinks: false } do
image_tag 'iiif-drag-n-drop.svg', width: width, alt: 'IIIF Drag-n-drop'
link_to link_url, class: 'iiif-dnd float-right', data: { turbolinks: false },
aria: { label: "IIIF Drag-n-drop: #{document['title_display']}" } do
image_tag 'iiif-drag-n-drop.svg', width: width, alt: ''
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_embedded_mirador3.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
scrolling: 'no',
width: '100%'
%>
<%= iiif_drag_n_drop(manifest_url) %>
<%= iiif_drag_n_drop(manifest_url, document:) %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<div class='col-2 col-md-1'>
<% exhibit_specific_manifest = document.exhibit_specific_manifest(current_exhibit&.required_viewer&.custom_manifest_pattern) %>
<%= iiif_drag_n_drop(exhibit_specific_manifest, width: '30') if exhibit_specific_manifest %>
<%= iiif_drag_n_drop(exhibit_specific_manifest, document:, width: '30') if exhibit_specific_manifest %>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/viewers/_mirador3.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
scrolling: 'no',
width: '100%'
%>
<%= iiif_drag_n_drop(exhibit_specific_manifest) %>
<%= iiif_drag_n_drop(exhibit_specific_manifest, document:) %>
<% end %>

0 comments on commit 05672a7

Please sign in to comment.