PageSourceSearch

https://simplehomeedit.com/wp-content/cache/min/1/wp-content/plugi…/breakdance-faq@1/faq.js?ver=1790723233

js simplehomeedit.com collected 2026-10-02 06:57:56 UTC 3,250 bytes, 21 lines download raw bytes

1(function(){const{mergeObjects}=BreakdanceFrontend.utils;class BreakdanceFaq{options={accordion:!1,openFirst:!1,};constructor(selector,options){this.selector=selector;this.options=mergeObjects(this.options,options||{});this.init()}
2toggleItem(event,item){const targetEl=item?item:event.target;const faqEl=targetEl.closest(".bde-faq__item");const isActive=faqEl.classList.contains("is-active");if(this.options.accordion){this.closeAllItemsExcept(targetEl)}
3if(isActive){this.closeItem(targetEl)}else{this.showItem(targetEl)}}
4closeAllItems(){this.elements.forEach((item)=>this.closeItem(item))}
5closeAllItemsExcept(item){this.elements.filter((el)=>el!==item).forEach((el)=>this.closeItem(el))}
6isTransitioning(item){return item.classList.contains("is-collapsing")}
7isActive(item){return item.classList.contains("is-active")}
8async closeItem(item){const faqEl=item.closest(".bde-faq__item");if(this.isTransitioning(faqEl))return;if(!this.isActive(faqEl))return;const faqButton=faqEl.querySelector(".bde-faq__question");const faqContent=faqEl.querySelector(".bde-faq__answer");const endHeight=this.getEndHeight(faqContent);faqContent.style.height=`${endHeight}px`;this.reflow(faqContent);faqEl.classList.add("is-collapsing");faqEl.classList.remove("is-active");faqContent.style.height="";faqButton.setAttribute("aria-expanded",!1);await this.onTransitionEnd(faqContent);faqEl.classList.remove("is-collapsing")}
9async showItem(item,instant=!1){const faqEl=item.closest(".bde-faq__item");if(this.isTransitioning(faqEl))return;if(this.isActive(faqEl))return;const faqButton=faqEl.querySelector(".bde-faq__question");const faqContent=faqEl.querySelector(".bde-faq__answer");const complete=()=>{faqEl.classList.add("is-active");faqEl.classList.remove("is-collapsing");faqContent.style.height=""};if(instant){complete();faqButton.setAttribute("aria-expanded",!0);return}
10faqEl.classList.add("is-collapsing");faqContent.style.height="0px";const endHeight=this.getEndHeight(faqContent);faqContent.style.height=`${endHeight}px`;faqButton.setAttribute("aria-expanded",!0);await this.onTransitionEnd(faqContent);complete()}
11getEndHeight(element){const height=element.getBoundingClientRect().height;return Math.max(element.scrollHeight,height)}
12reflow(element){element.offsetHeight}
13update(options={}){this.options=mergeObjects(this.options,options);this.destroy();this.init()}
14openFirst(){if(!this.elements[0])return;this.showItem(this.elements[0],!0)}
15onTransitionEnd(item){const duration=window.getComputedStyle(item).getPropertyValue("transition-duration");if(duration==="0s"){return Promise.resolve()}
16return new Promise((resolve)=>{item.addEventListener("transitionend",resolve,{once:!0})})}
17destroy(){this.elements=Array.from(document.querySelectorAll(`${this.selector} .js-faq-item`));if(!this.elements)return;this.closeAllItems();this.elements.forEach((item)=>item.removeEventListener("click",this.onClick))}
18bindClickListeners(){this.onClick=this.toggleItem.bind(this);this.elements.forEach((item)=>{item.addEventListener("click",this.onClick)})}
19init(){this.elements=Array.from(document.querySelectorAll(`${this.selector} .js-faq-item`));if(this.options.openFirst===!0){this.openFirst()}
20this.bindClickListeners()}}
21window.BreakdanceFaq=BreakdanceFaq})()

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.