For assets used on more than one page
CardWrapper.html, CarouselContainer.html, Jumbotron.html
// Carousel - Page/Assets.html
var carousels = document.querySelectorAll('.carousel .carousel-inner .carousel-item:first-child');
if ( carousels.length ) {
carousels.forEach( carousel => {
carousel.classList.add('active');
});
}
Button.html, Page/Assets.html
// Fixed button group on left or right browser edge - Page/Assets.html
var buttonsFixedPosition = document.querySelectorAll('.fixedPosition');
var visiblePart = {visiblePart};
var btnSlideOutCorrection = {settings.btnSlideOutCorrection};
if ( buttonsFixedPosition.length ) {
t3sbFixedButtons(buttonsFixedPosition, visiblePart, btnSlideOutCorrection);
}
// Fixed button on left or right browser edge - Page/Assets.html
var buttonsFixedPosition = document.querySelectorAll('.fixedPosition');
if ( buttonsFixedPosition.length ) {
t3sbFixedButtons(buttonsFixedPosition, 0);
}
Page/Section.html, Page/MenuSection.html
// Sectionmenu scrollspy - Page/Assets.html
document.body.setAttribute('data-bs-spy', 'scroll');
document.body.setAttribute('data-bs-target', '#sectionmenu');
document.body.setAttribute('data-bs-offset', {settings.config.sectionmenuScrollspyOffset});
document.body.setAttribute('tabindex', '0');
document.body.style.position = 'relative';
if (document.body.style.overflowY) {
document.body.style.overflowY = 'unset';
}
var sectionmenu = document.getElementById('sectionmenu');
sectionmenu.querySelectorAll('a').forEach( link => {
link.addEventListener('click', function(l) {
if (document.body.style.overflowY) {
document.body.style.overflowY = 'unset';
}
event.preventDefault();
t3sbScrollToAnchor({t3sb:intval(number: '{settings.config.sectionmenuAnchorOffset}')}, fixedNavbar, navbarHeight, l.currentTarget.getAttribute('href'));
});
});
window.onscroll = function() {stickyFunction()};
var sticky = sectionmenu.offsetTop;
var maincontent = document.getElementsByClassName('main-content');
function stickyFunction() {
if (window.pageYOffset + navbarHeight >= sticky) {
sectionmenu.style.width = maincontent[0].clientWidth+'px';
sectionmenu.style.position = 'fixed';
sectionmenu.style.top = navbarHeight+'px';
} else {
sectionmenu.style.position = 'inherit';
}
}