Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sidebar sticky #140

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inst/pkgdown/assets/assets/scripts.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/pkgdown/assets/assets/styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/pkgdown/assets/assets/styles.css.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions inst/pkgdown/templates/navbar.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- START: inst/pkgdown/templates/navbar.html -->
<div id="sidebar-col" class="col-lg-4{{#overview}} overview-sidebar{{/overview}}">
<div id="sidebar" class="sidebar">
<div id="sidebar" class="sidebar" style="display: flex">
<nav aria-labelledby="flush-headingEleven">
<button role="button" aria-label="{{ translate.CloseMenu }}" alt="{{ translate.CloseMenu }}" aria-expanded="true" aria-controls="sidebar" class="collapse-toggle" data-collapse="{{ translate.Collapse }} " data-episodes="{{ translate.Episodes }} ">
<button role="button" aria-label="{{ translate.CloseMenu }}" alt="{{ translate.CloseMenu }}" aria-expanded="true" aria-controls="sidebar" class="collapse-toggle sticky-top" data-collapse="{{ translate.Collapse }} " data-episodes="{{ translate.Episodes }} ">
<i class="search-icon" data-feather="x" role="img"></i>
</button>
<div class="sidebar-inner">
<div class="sidebar-inner sticky-top">
<div class="row mobile-row">
<div class="col">
<div class="sidenav-view-selector">
Expand Down
5 changes: 3 additions & 2 deletions source/javascripts/custom/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ function showSidebarMobile(){
setSidebarVisible(true);
if (window.innerWidth < 768) {
$sidebar.css({
display: '',
display: 'flex',
position: 'absolute',
top: '150px',
left: '0px',
right: '0px'
});
} else {
$sidebar.css({
display: '',
display: 'flex',
position: 'absolute',
top: '200px',
left: '0px',
Expand Down Expand Up @@ -242,6 +242,7 @@ function showSidebarDesktop(){
var $sidebarInner = $('.sidebar-inner');
var $collapseToggle = $('.collapse-toggle');
$sidebar.css({
display: 'flex',
position: 'relative',
top: '0px'
});
Expand Down
4 changes: 3 additions & 1 deletion source/stylesheets/sidenav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
}

.collapse-toggle {
top: 10px;
float: right;
margin-right: 10px;
margin-top: -25px;
Expand All @@ -99,6 +100,7 @@
}

.sidebar-inner {
top: 50px; // MM 2024-05-29: offset so it doesn't overlap with the "collapse" button
margin-left: 65px;
margin-right: 60px;
padding-left: 20px;
Expand Down Expand Up @@ -154,7 +156,7 @@
@include media-breakpoint-up(xl) {

.sidebar {
display: block;
display: flex;
position: relative;
top: 0px;
height:100%;
Expand Down
Loading