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

Fix #2345
This commit is contained in:
George Cushen committed 2021-06-19 23:45:13 +01:00
1 parent caf535a66d
commit b739d8d390
1 file changed
+1 -1
+1 -1
View File
@@ -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;
}