File manager - Edit - /home/vblioqus/unfreezetiktok.com/wp-content/plugins/kadence-blocks/includes/assets/js/kb-header-sticky-image.min.js
Back
class KBStickyImage{constructor(a,b={}){this.root="string"==typeof a?document.querySelector(a):a,this.state="CREATED",this.isLogo=this.root.classList.contains("kb-identity"),this.standardElem=this.isLogo?this.root.querySelector(".custom-logo"):this.root.querySelector(".kb-img:not(.kb-img-sticky):not(.kb-img-transparent)"),this.stickyElem=this.root.querySelector(".kb-img-sticky"),this.transparentElem=this.root.querySelector(".kb-img-transparent"),this.isSticking=!1,this.isTransparentDesktop=this.root.closest(".wp-block-kadence-header")?.classList?.contains("header-desktop-transparent"),this.isTransparentTablet=this.root.closest(".wp-block-kadence-header")?.classList?.contains("header-tablet-transparent"),this.isTransparentMobile=this.root.closest(".wp-block-kadence-header")?.classList?.contains("header-mobile-transparent"),this.stickyElem&&this.initStickyTracking(),this.emitEvent("MOUNTED"),this.state="IDLE"}initStickyTracking(){window.addEventListener("KADENCE_HEADER_STICKY_CHANGED",this.toggleSticky.bind(this))}toggleSticky({isSticking:a}){this.isSticking=a,a?this.setStickyStyles():this.setStandardStyles()}setStickyStyles(){this.stickyElem&&(this.stickyElem.style.display="initial"),this.standardElem&&(this.standardElem.style.display="none"),this.transparentElem&&(this.transparentElem.style.display="none")}setStandardStyles(){const a=this.getActiveSize(),b="desktop"==a&&this.isTransparentDesktop||"tablet"==a&&this.isTransparentTablet||"mobile"==a&&this.isTransparentMobile;this.stickyElem&&(this.stickyElem.style.display="none"),this.transparentElem&&!this.isLogo&&(this.transparentElem.style.display="none"),b?this.transparentElem&&(this.transparentElem.style.display="initial"):this.standardElem&&(this.standardElem.style.display="initial")}getActiveSize(){if(parseInt(kadenceHeaderConfig.breakPoints.desktop)<window.innerWidth)return"desktop";return parseInt(kadenceHeaderConfig.breakPoints.tablet)<window.innerWidth?"tablet":"mobile"}get state(){return this._state}set state(a){this._state=a,this.emitEvent("STATE",{val:a})}emitEvent(a,b={}){const c=new CustomEvent(a,{bubbles:!0,detail:b});this.root.dispatchEvent(c)}}function initKBImages(){const a=document.querySelectorAll(".wp-block-kadence-image, .wp-block-kadence-identity");window.KBStickyBlocks=Array.from(a).map(a=>new KBStickyImage(a))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",initKBImages):initKBImages(),window.KBStickyImage=KBStickyImage;
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings