Skip to content

Commit

Permalink
Make sidebar hierarchy sticky
Browse files Browse the repository at this point in the history
  • Loading branch information
lfarrell committed Dec 5, 2023
1 parent 7c1cc18 commit 64ff7fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 5 additions & 3 deletions app/assets/stylesheets/arclight/modules/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@

// offcanvas sidebar is scrollable for smaller screens
#sidebar {
overflow-y: scroll;

@include media-breakpoint-up(lg) {
overflow: hidden;
.sidebar-items {
height: 100vh;
overflow-y: auto;
position: sticky;
}
}
}

Expand Down
10 changes: 6 additions & 4 deletions app/components/arclight/sidebar_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<div class="offcanvas-lg offcanvas-start p-3 p-lg-1" tabindex="-1" id="sidebar">
<%= collection_context %>
<%= render 'show_tools', document: document %>
<%= collection_sidebar %>
<div id="collection-context" class="sidebar-section">
<h2><%= t('arclight.views.show.has_content') %></h2>
<%= turbo_frame_tag "al-hierarchy-#{document.root}", loading: 'lazy', src: hierarchy_solr_document_path(id: document.root, nest_path: @document.nest_path, hierarchy: true) %>
<div class="sidebar-items">
<%= collection_sidebar %>
<div id="collection-context" class="sidebar-section">
<h2><%= t('arclight.views.show.has_content') %></h2>
<%= turbo_frame_tag "al-hierarchy-#{document.root}", loading: 'lazy', src: hierarchy_solr_document_path(id: document.root, nest_path: @document.nest_path, hierarchy: true) %>
</div>
</div>
</div>

0 comments on commit 64ff7fe

Please sign in to comment.