PageSourceSearch

https://adriasolapastor.com/wp-content/plugins/nextbricks/elements/js/bc_simple_menu.min.js?ver=1.10.1

js adriasolapastor.com collected 2026-10-04 13:26:45 UTC 4,574 bytes, 13 lines download raw bytes

1function manipularTabIndex(e){e.hasAttribute("tabindex")&&"-1"===e.getAttribute("tabindex")?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1");let t=e.children;for(let e=0;e<t.length;e++)manipularTabIndex(t[e]);}
2function applyTabIndexRecursively(element){if(element.nodeType===Node.ELEMENT_NODE){if(!element.hasAttribute("tabindex")||element.getAttribute("tabindex")!=="-1"){element.setAttribute("tabindex","-1")}
3Array.from(element.children).forEach(applyTabIndexRecursively)}}
4function simple_menu(){let e=window.location.href.includes("brickspreview");document.querySelectorAll(".bc-simple-menu").forEach((t)=>{let toggleBody=t.getAttribute("data-customtoggle-lock-body-scrolling")==="1";let closeOnEsc=t.getAttribute("data-close-on-esc")==="1";var r=t.getAttribute("data-open-builder");let o=!1,n=t.querySelector(".bc-simple-menu__content");var a=t.getAttribute("data-duration"),u=t.getAttribute("data-easing");1!=t.getAttribute("data-fade")&&(a=0.001);var i=gsap.timeline({paused:!0});i.to(n,{onStart:function(){t.hasAttribute("data-aux-fade","1")&&t.removeAttribute("data-aux-fade","1")},duration:parseFloat(a),ease:u,opacity:1,onReverseComplete:function(){t.setAttribute("data-aux-fade","1")},});let d=t.querySelectorAll(".bc-core-burguer"),l=!1,s=t.getAttribute("data-customtoggle");var b=s.replace(".","");if(s)var m=document.querySelectorAll(s);if(!e){const observer=new MutationObserver((mutations)=>{mutations.forEach((mutation)=>{if(mutation.type==="childList"){mutation.addedNodes.forEach((node)=>{if(node.nodeType===Node.ELEMENT_NODE){applyTabIndexRecursively(node)}})}})});observer.observe(n,{childList:!0,subtree:!0})}
5function p(){manipularTabIndex(n);d.forEach((e)=>{let button=e.querySelector("button");if(!button)return;let r=button.classList,o="";r.length>0&&(o=`${r[0]}--opened`),l?(r.remove(o),button.setAttribute("aria-expanded","false"),(n.style.pointerEvents="none"),t.removeAttribute("data-open","bc-simple-menu--opened"),i.reverse()):(r.add(o),button.setAttribute("aria-expanded","true"),(n.style.pointerEvents="all"),t.setAttribute("data-open","bc-simple-menu--opened"),i.play())});if(d.length===0){l?(t.removeAttribute("data-open","bc-simple-menu--opened"),i.reverse(),(n.style.pointerEvents="none")):(t.setAttribute("data-open","bc-simple-menu--opened"),i.play(),(n.style.pointerEvents="all"))}
6m&&m.forEach((e)=>{let button=e.querySelector("button");if(!button)return;let r=button.classList,o="";r.length>0&&(o=`${r[0]}--opened`),l?(r.remove(o),button.setAttribute("aria-expanded","false"),t.removeAttribute("data-open","bc-simple-menu--opened"),i.reverse(),(n.style.pointerEvents="none")):(r.add(o),button.setAttribute("aria-expanded","true"),t.setAttribute("data-open","bc-simple-menu--opened"),i.play(),(n.style.pointerEvents="all"))});l=!l}
7if(e&&r=="1"){i.play()}
8manipularTabIndex(n);function toggleBodyScroll(){if(toggleBody){if(document.querySelector("html").hasAttribute("bc-core-burguer--body-toggled")){if(window.lenisInstance){window.lenisInstance.start()}}else{if(window.lenisInstance){window.lenisInstance.stop()}}
9document.querySelector("html").toggleAttribute("bc-core-burguer--body-toggled")}}
10if(s){var g=document.querySelectorAll(s);g.forEach((element)=>{if(!element.hasAttribute("tabindex")){element.setAttribute("tabindex","0")}
11element.addEventListener("click",function(){toggleBodyScroll();p()});element.addEventListener("keydown",function(event){if(event.key==="Enter"){toggleBodyScroll();p();event.stopImmediatePropagation()}})})}
12document.addEventListener("click",function(e){n.contains(e.target)||(m&&Array.from(m).some((t)=>t.contains(e.target)))||(d&&Array.from(d).some((t)=>t.contains(e.target)))||(l&&p(),o&&document.querySelector("html").hasAttribute("bc-core-burguer--body-toggled")&&document.querySelector("html").removeAttribute("bc-core-burguer--body-toggled"));if(window.lenisInstance){window.lenisInstance.start()}}),d.forEach((e)=>{let button=e.querySelector("button");if(!button)return;1==parseFloat(button.getAttribute("data-scroll"))&&(o=!0),e.addEventListener("click",function(){p()})}),window.location.href.includes("brickspreview")||document.addEventListener("keydown",function(e){if(l&&closeOnEsc&&"Escape"===e.key){p();if(o&&document.querySelector("html").hasAttribute("bc-core-burguer--body-toggled")){document.querySelector("html").removeAttribute("bc-core-burguer--body-toggled")}}}),n.addEventListener("focusout",function(e){if(e.relatedTarget&&!n.contains(e.relatedTarget)){l&&p()}})})}
13document.addEventListener("DOMContentLoaded",function(e){bricksIsFrontend&&simple_menu()})

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.