Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbyte committed Jan 21, 2025
1 parent f8cc739 commit 1a5ee4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions layouts/partials/navigation/nav-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

<li class="menu-row {{ if .NavPage.IsPage }}child{{end}}" style="overflow: hidden;" data-roles="{{ $roles }}">
<div class="link level-{{ .Level }}">
<!-- data-target is used by the scrollspy on presidium-js to determine which section of the page the <a> corresponds to -->
<a class="level-{{ .Level }} {{ if eq .Index 0 }}first-child{{end}}" data-slug="{{ $slug }}" data-target="#{{$uid}}" data-id="{{ $articleId }}" href="{{ $articleLink }}">
{{ if $hasChildren }}
<div class="menu-expander" aria-controls="{{$uid}}">
Expand Down
6 changes: 4 additions & 2 deletions layouts/partials/page/script.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
$menu.toggleClass('expanded', !isOpen).toggleClass('', isOpen);
});

//Handle open and closing of nav-items
// Handle collapsing of nav-items
const toggleMenu = ($menu, isOpen) => {
const $ul = $menu.find('ul').first();

Expand All @@ -44,6 +44,7 @@
.toggleClass('glyphicon-chevron-right', !isOpen);
};

// Bootstrap collapse events
$('li.menu-row').on('show.bs.collapse', (event) => {
event.stopPropagation();
const $menu = $(event.currentTarget);
Expand Down Expand Up @@ -121,6 +122,7 @@
},
});

// Ensure nav-items fit within the viewport without overlapping the header
document.addEventListener("DOMContentLoaded", function () {
const navbarHeader = document.querySelector(".navbar-header");
const navbarItems = document.querySelector(".navbar-items");
Expand All @@ -131,7 +133,7 @@
navbarItems.style.maxHeight = `calc(100vh - ${headerHeight}px)`;
}

// Optional: Adjust height dynamically during window resize
// Adjust height dynamically during window resize
window.addEventListener("resize", function () {
if (navbarHeader && navbarItems) {
const headerHeight = navbarHeader.offsetHeight;
Expand Down

0 comments on commit 1a5ee4f

Please sign in to comment.