Skip to content

Commit

Permalink
Make sidebar sticky (#26)
Browse files Browse the repository at this point in the history
* Make sidebar sticky

* regenerated css/js

---------

Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
milanmlft and actions-user authored May 31, 2024
1 parent 828cf36 commit 593fa51
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
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,20 +1,20 @@
<!-- 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"
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

0 comments on commit 593fa51

Please sign in to comment.