Skip to content

Commit

Permalink
make nav script resilient if nav container is missing from page
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Feb 13, 2024
1 parent 5139e7f commit 1849327
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/js/01-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
var SECT_CLASS_RX = /^sect[0-5](?=$| )/

var navContainer = document.querySelector('.nav-container')
if (!navContainer) return
var navToggle = document.querySelector('.toolbar .nav-toggle')

navToggle.addEventListener('click', showNav)
Expand Down

0 comments on commit 1849327

Please sign in to comment.