Skip to content

Commit

Permalink
Feat: improve nav
Browse files Browse the repository at this point in the history
Resolves #194
  • Loading branch information
oodamien committed Mar 26, 2024
1 parent e0016e3 commit 443b5ea
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/js/01-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
menuPanel.scrollTop = 0
}

var currentActivePageItem = menuPanel.querySelector('.nav-item.is-current-page.is-active')
if (currentActivePageItem && currentActivePageItem.querySelector('.nav-item-toggle')) {
currentActivePageItem.querySelector('.nav-link').addEventListener('click', function (e) {
currentActivePageItem.querySelector('.nav-item-toggle').click()
e.preventDefault()
return false
})
}

find(menuPanel, '.nav-item-toggle').forEach(function (btn) {
var li = btn.parentElement
btn.addEventListener('click', toggleActive.bind(li))
Expand All @@ -41,8 +50,6 @@
}
})

// var isOpen = false

document.querySelector('#browse-version').addEventListener('click', function () {
MicroModal.show('modal-versions', {
disableScroll: true,
Expand Down

0 comments on commit 443b5ea

Please sign in to comment.