Browse Source

fix: anchor linking (e.g. ToC) does not work when navbar is disabled

Fix #2345
George Cushen 3 years ago
parent
commit
b739d8d390
1 changed files with 1 additions and 1 deletions
  1. 1 1
      wowchemy/assets/js/wowchemy.js

+ 1 - 1
wowchemy/assets/js/wowchemy.js

@@ -24,7 +24,7 @@ console.debug(`Environment: ${hugoEnvironment}`);
 // Dynamically get responsive navigation bar height for offsetting Scrollspy.
 function getNavBarHeight() {
   let navbar = document.getElementById('navbar-main');
-  let navbarHeight = (navbar) ? navbar.outerHeight() : 0;
+  let navbarHeight = (navbar) ? navbar.getBoundingClientRect().height : 0;
   console.debug('Navbar height: ' + navbarHeight);
   return navbarHeight;
 }