Skip to content

Commit

Permalink
Merge pull request #178 from vstollen/177-bootstrap-5
Browse files Browse the repository at this point in the history
Add Bootstrap 5 support
  • Loading branch information
jcoyne authored Nov 17, 2021
2 parents 3988898 + fe444da commit ef559f9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ BlacklightRangeLimit.buildSlider = function buildSlider(thisContext) {
var max = boundaries[1];

if (BlacklightRangeLimit.isInt(min) && BlacklightRangeLimit.isInt(max)) {
$(thisContext).contents().wrapAll('<div class="sr-only" />');
$(thisContext).contents().wrapAll('<div class="sr-only visually-hidden" />');

var range_element = $(thisContext);
var form = $(range_element).closest(".range_limit").find("form.range_limit");
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/range_limit_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def render_range_input(solr_field, type, input_label = nil, maxlength=4)
default = params["range"][solr_field][type] if params["range"] && params["range"][solr_field] && params["range"][solr_field][type]

html = number_field_tag("range[#{solr_field}][#{type}]", default, :maxlength=>maxlength, :class => "form-control text-center range_#{type}")
html += label_tag("range[#{solr_field}][#{type}]", input_label, class: 'sr-only') if input_label.present?
html += label_tag("range[#{solr_field}][#{type}]", input_label, class: 'sr-only visually-hidden') if input_label.present?
html
end

Expand Down
5 changes: 3 additions & 2 deletions app/views/blacklight_range_limit/_range_limit_panel.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<span class="selected"><%= range_display(field_name) %></span>
<%= link_to search_action_url(remove_range_param(field_name).except(:controller, :action)), :class=>"remove", :title => t('blacklight.range_limit.remove_limit') do %>
<span class="remove-icon"></span>
<span class="sr-only">[<%= t('blacklight.range_limit.remove_limit') %>]</span>
<span class="sr-only visually-hidden">[<%= t('blacklight.range_limit.remove_limit') %>]</span>
<% end %>
</span>
<span class="selected facet-count"><%= number_with_delimiter(@response.total) %></span>
Expand Down Expand Up @@ -61,9 +61,10 @@
<div class="input-group input-group-sm mb-3 flex-nowrap range-limit-input-group">
<%= render_range_input(field_name, :begin, input_label_range_begin, maxlength) %>
<%= render_range_input(field_name, :end, input_label_range_end, maxlength) %>
<div class="input-group-append">
<div class="input-group-append visually-hidden">
<%= submit_tag t('blacklight.range_limit.submit_limit'), class: BlacklightRangeLimit.classes[:submit] %>
</div>
<%= submit_tag t('blacklight.range_limit.submit_limit'), class: BlacklightRangeLimit.classes[:submit] + " sr-only", "aria-hidden": "true" %>
</div>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/blacklight_range_limit/range_limit_panel.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="modal-header">
<h1 class="modal-title"><%= facet_field_label(@facet.key) %></h1>
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
<span aria-hidden="true">&times;</span>
<button type="button" class="blacklight-modal-close btn-close close" data-bs-dismiss="modal" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
<span aria-hidden="true" class="visually-hidden">&times;</span>
</button>
</div>

Expand Down
2 changes: 1 addition & 1 deletion spec/features/blacklight_range_limit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
visit search_catalog_path(page: 2)
click_link 'View distribution'
click_link '2000 to 2008'
click_button 'Apply'
click_button 'Apply', match: :first
expect(page.current_url).not_to include('page')
end

Expand Down

0 comments on commit ef559f9

Please sign in to comment.