Skip to content

Commit f8d9cfb

Browse files
authored
Fix facet prev/next pagination nav display within and outside of modals. Fixes #3524 (#3548)
- render pagination & sort links near the top so scrolling isn't necessary to see/click them - style the top & bottom nav consistently - ensure these elements wrap appropriately in mobile/narrow viewports - improve display of facet browse UI when viewed on a facet page (as opposed to modal)
1 parent 326ab33 commit f8d9cfb

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

app/assets/builds/blacklight.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,6 @@ main {
423423
border-radius: 5px;
424424
}
425425

426-
.modal-content .facet-pagination.top {
427-
display: none; /* Doesn't display in a modal, but would display on a new page (e.g. without Javascript) */
428-
}
429426
.modal-content .page-sidebar {
430427
display: none;
431428
}
@@ -437,6 +434,12 @@ main {
437434
display: none;
438435
}
439436

437+
.modal-footer:not(.modal .modal-footer) {
438+
border-top: var(--bs-border-width) solid var(--bs-border-color);
439+
padding-top: 1rem;
440+
margin-top: 1rem;
441+
}
442+
440443
.remove .bi {
441444
height: 1em;
442445
width: 1em;

app/assets/stylesheets/blacklight/_modal.scss

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
}
44

55
.modal-content {
6-
.facet-pagination.top {
7-
display: none; /* Doesn't display in a modal, but would display on a new page (e.g. without Javascript) */
8-
}
9-
106
.page-sidebar {
117
display: none;
128
}
@@ -21,3 +17,12 @@
2117
.blacklight-modal-close {
2218
display: none;
2319
}
20+
21+
// When modal content is rendered outside of a modal, Bootstrap css variables like
22+
// --bs-modal-footer-border-width are undefined (only in .modal scope). So we apply
23+
// light styling to the modal footer when it's not in a modal.
24+
.modal-footer:not(.modal .modal-footer) {
25+
border-top: var(--bs-border-width) solid var(--bs-border-color);
26+
padding-top: 1rem;
27+
margin-top: 1rem;
28+
}

app/views/catalog/facet.html.erb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<%= render Blacklight::System::ModalComponent.new do |component| %>
2-
<% component.with_prefix do %>
3-
<div class="facet-pagination top d-flex w-100 justify-content-between">
4-
<%= render :partial=>'facet_pagination' %>
5-
</div>
6-
<% end %>
72

8-
<% component.with_title { facet_field_label(@facet.key) } %>
9-
<%= render Blacklight::Search::FacetSuggestInput.new(facet: @facet, presenter: @presenter) %>
3+
<div class="card card-body bg-light p-3 mb-3 border-0">
4+
<% component.with_title { facet_field_label(@facet.key) } %>
5+
<%= render Blacklight::Search::FacetSuggestInput.new(facet: @facet, presenter: @presenter) %>
6+
<%= render partial: 'facet_index_navigation' if @facet.index_range && @display_facet.index? %>
107

11-
<%= render partial: 'facet_index_navigation' if @facet.index_range && @display_facet.index? %>
8+
</div>
9+
10+
<div class="facet-pagination top d-flex flex-wrap w-100 justify-content-between border-bottom pb-3 mb-3">
11+
<%= render :partial=>'facet_pagination' %>
12+
</div>
1213

1314
<div class="facet-extended-list">
1415
<%= render Blacklight::FacetComponent.new(display_facet: @display_facet,
@@ -17,7 +18,7 @@
1718
</div>
1819

1920
<% component.with_footer do %>
20-
<div class="facet-pagination bottom flex-row justify-content-between">
21+
<div class="facet-pagination bottom d-flex flex-wrap w-100 justify-content-between">
2122
<%= render :partial=>'facet_pagination' %>
2223
</div>
2324
<% end %>

0 commit comments

Comments
 (0)