Account for pages not having a hero
Eg the homepage
This commit is contained in:
parent
6996e191e5
commit
1c9e1b4f74
1 changed files with 7 additions and 7 deletions
|
@ -91,8 +91,13 @@ window.addEventListener("load", () => {
|
|||
});
|
||||
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
setHeroHeight();
|
||||
handleHeroStuck();
|
||||
if (HERO) {
|
||||
setHeroHeight();
|
||||
handleHeroStuck();
|
||||
|
||||
window.addEventListener("resize", debounce(setHeroHeight, 2000));
|
||||
window.addEventListener("scroll", throttle(handleHeroStuck, 100));
|
||||
}
|
||||
|
||||
if (window.location.hash <= 1) {
|
||||
return;
|
||||
|
@ -111,8 +116,3 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
|
||||
scrollToElement(scrollTarget, "auto");
|
||||
});
|
||||
|
||||
if (HERO) {
|
||||
window.addEventListener("resize", debounce(setHeroHeight, 2000));
|
||||
window.addEventListener("scroll", throttle(handleHeroStuck, 100));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue