first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
/**
* brands.js
*
* Adds sticky functionality to the brands index.
*/
( function() {
document.addEventListener( 'DOMContentLoaded', function() {
var brandsAZ = document.getElementsByClassName( 'brands_index' );
if ( ! brandsAZ.length ) {
return;
}
var adminBar = document.body.classList.contains( 'admin-bar' ) ? 32 : 0,
brandsContainerHeight = document.getElementById( 'brands_a_z' ).scrollHeight,
brandsAZHeight = brandsAZ[0].scrollHeight + 40;
var stickyBrandsAZ = function() {
if ( window.innerWidth > 768 && brandsAZ[0].getBoundingClientRect().top < 0 ) {
brandsAZ[0].style.paddingTop = Math.min( ( Math.abs( brandsAZ[0].getBoundingClientRect().top ) + 20 + adminBar ), brandsContainerHeight - brandsAZHeight ) + 'px';
} else {
brandsAZ[0].style.paddingTop = 0;
}
};
stickyBrandsAZ();
window.addEventListener( 'scroll', function() {
stickyBrandsAZ();
} );
} );
} )();

View File

@@ -0,0 +1 @@
document.addEventListener("DOMContentLoaded",function(){var n=document.getElementsByClassName("brands_index");if(n.length){var t=document.body.classList.contains("admin-bar")?32:0,e=document.getElementById("brands_a_z").scrollHeight,d=n[0].scrollHeight+40,i=function(){768<window.innerWidth&&n[0].getBoundingClientRect().top<0?n[0].style.paddingTop=Math.min(Math.abs(n[0].getBoundingClientRect().top)+20+t,e-d)+"px":n[0].style.paddingTop=0};i(),window.addEventListener("scroll",function(){i()})}});

View File

@@ -0,0 +1,24 @@
/**
* Makes the header cart content scrollable if the height of the dropdown exceeds the window height.
* Mouseover is used as items can be added to the cart via ajax and we'll need to recheck.
*/
( function() {
if ( document.body.classList.contains( 'woocommerce-cart' ) || document.body.classList.contains( 'woocommerce-checkout' ) || window.innerWidth < 768 || ! document.getElementById( 'site-header-cart' ) ) {
return;
}
window.addEventListener( 'load', function() {
var cart = document.querySelector( '.site-header-cart' );
cart.addEventListener( 'mouseover', function() {
var windowHeight = window.outerHeight,
cartBottomPos = this.querySelector( '.widget_shopping_cart_content' ).getBoundingClientRect().bottom + this.offsetHeight,
cartList = this.querySelector( '.cart_list' );
if ( cartBottomPos > windowHeight ) {
cartList.style.maxHeight = '15em';
cartList.style.overflowY = 'auto';
}
} );
} );
} )();

View File

@@ -0,0 +1 @@
document.body.classList.contains("woocommerce-cart")||document.body.classList.contains("woocommerce-checkout")||window.innerWidth<768||!document.getElementById("site-header-cart")||window.addEventListener("load",function(){document.querySelector(".site-header-cart").addEventListener("mouseover",function(){var e=window.outerHeight,t=this.querySelector(".widget_shopping_cart_content").getBoundingClientRect().bottom+this.offsetHeight,o=this.querySelector(".cart_list");e<t&&(o.style.maxHeight="15em",o.style.overflowY="auto")})});