Skip to content

Commit

Permalink
BUGFIX: JS error if using NO navbar -> #150
Browse files Browse the repository at this point in the history
  • Loading branch information
t3solution authored Oct 21, 2021
1 parent 33d2e8b commit 4558c0a
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions Resources/Private/Templates/Main.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ <h3 class="text-danger text-center mt-5">The main configuration has to be create
}
</f:asset.script>
</f:then>
<f:else>
<f:asset.script identifier="vanilla_default">
<f:else>
<f:if condition="{config.navbar.enable}">
<f:then>
<f:asset.script identifier="vanilla_default">
// Default - Main.html
const navbar = document.getElementById('main-navbar'),
navbarHeight = navbar.clientHeight,
Expand All @@ -139,7 +141,26 @@ <h3 class="text-danger text-center mt-5">The main configuration has to be create
if (window.location.hash) {
t3sbScrollToAnchor({t3sb:intval(number: '{settings.config.sectionmenuAnchorOffset}')}, fixedNavbar, navbarHeight);
}
</f:asset.script>
</f:asset.script>
</f:then>
<f:else>
<f:asset.script identifier="vanilla_default">
// Default - Main.html
const navbar = false,
navbarHeight = false,
navbarBreakpointWidth = 99999,
viewportWidth = parseFloat(getComputedStyle(document.querySelector('html'), null).width.replace("px", "")),
onePageLayout = 0;

var fixedNavbar = false;

// Scroll anchor - Main.html
if (window.location.hash) {
t3sbScrollToAnchor({t3sb:intval(number: '{settings.config.sectionmenuAnchorOffset}')}, fixedNavbar, navbarHeight);
}
</f:asset.script>
</f:else>
</f:if>
</f:else>
</f:if>
<f:comment> Loading spinner </f:comment>
Expand Down

0 comments on commit 4558c0a

Please sign in to comment.