mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 22:14:08 +00:00
fix: anchor linking (e.g. ToC) does not work when navbar is disabled
Fix #2345
This commit is contained in:
1 parent
cc42eb4135
commit
caf535a66d
1 file changed
+4
-4
@@ -23,10 +23,10 @@ console.debug(`Environment: ${hugoEnvironment}`);
|
||||
|
||||
// Dynamically get responsive navigation bar height for offsetting Scrollspy.
|
||||
function getNavBarHeight() {
|
||||
let $navbar = $('#navbar-main');
|
||||
let navbar_offset = $navbar.outerHeight();
|
||||
console.debug('Navbar height: ' + navbar_offset);
|
||||
return navbar_offset;
|
||||
let navbar = document.getElementById('navbar-main');
|
||||
let navbarHeight = (navbar) ? navbar.outerHeight() : 0;
|
||||
console.debug('Navbar height: ' + navbarHeight);
|
||||
return navbarHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user