PageSourceSearch

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

js adriasolapastor.com collected 2026-10-04 13:26:46 UTC 8,473 bytes, 19 lines download raw bytes

1function manipularTabIndex(t){t.hasAttribute("tabindex")&&"-1"===t.getAttribute("tabindex")?t.removeAttribute("tabindex"):t.setAttribute("tabindex","-1");let e=t.children;for(let t=0;t<e.length;t++)manipularTabIndex(e[t]);}
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 multioffcanvasmenu(){let t=window.location.href.includes("brickspreview");document.querySelectorAll(".bc-multi-offcanvas-menu").forEach((e)=>{let toggleBody=e.getAttribute("data-customtoggle-lock-body-scrolling")==="1";let closeOnEsc=e.getAttribute("data-close-on-esc")==="1";var a=e.getAttribute("data-open-builder");let o=!1;var n=e.querySelector(".bc-multi-offcanvas-menu__items-wrapper"),r=e.querySelector(".bc-multi-offcanvas-menu__items-wrapper");e.getAttribute("data-type");let u=document.querySelectorAll(".bc-core-burguer"),c=e.querySelectorAll(".bc-multi-offcanvas-menu__subcanvas .bc-core-burguer"),i=e.querySelectorAll(".bc-core-burguer:not(.bc-multi-offcanvas-menu__subcanvas .bc-core-burguer)"),s=e.querySelector(".bc-multi-offcanvas-menu__backdrop"),l=!1,d=e.getAttribute("data-customtoggle");var b=d.replace(".","");if(!t){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 f(){manipularTabIndex(r);i.forEach((t)=>{let a=t.querySelector("button").classList,o="";a.length>0&&(o=`${a[0]}--opened`);if(l){t.querySelector("button").classList.remove(o);t.querySelector("button").setAttribute("aria-expanded","false");r.style.pointerEvents="none";e.removeAttribute("data-open","bc-multi-offcanvas-menu--opened")}else{t.querySelector("button").classList.add(o);t.querySelector("button").setAttribute("aria-expanded","true");r.style.pointerEvents="all";e.setAttribute("data-open","bc-multi-offcanvas-menu--opened")}
6n.hasAttribute("data-open")&&n.toggleAttribute("data-open");p()});u.forEach((t)=>{if(!e.contains(t)&&t.classList.contains(b)){let a=t.querySelector("button").classList,o="";a.length>0&&(o=`${a[0]}--opened`);if(l){t.querySelector("button").classList.remove(o);t.querySelector("button").setAttribute("aria-expanded","false");r.style.pointerEvents="none";e.removeAttribute("data-open","bc-multi-offcanvas-menu--opened")}else{t.querySelector("button").classList.add(o);t.querySelector("button").setAttribute("aria-expanded","true");r.style.pointerEvents="all";e.setAttribute("data-open","bc-multi-offcanvas-menu--opened")}
7n.hasAttribute("data-open")&&n.toggleAttribute("data-open");p()}});if(!u.length||!c.length){if(l){r.style.pointerEvents="none";e.removeAttribute("data-open","bc-multi-offcanvas-menu--opened")}else{r.style.pointerEvents="all";e.setAttribute("data-open","bc-multi-offcanvas-menu--opened")}
8n.hasAttribute("data-open")&&n.toggleAttribute("data-open");p()}
9l=!l}
10function p(){e.querySelectorAll(".bc-multi-offcanvas-menu__subcanvas").forEach((t)=>{t.hasAttribute("data-open")&&t.toggleAttribute("data-open")})}
11function g(t){e.querySelectorAll(".bc-multi-offcanvas-menu__subcanvas").forEach((e,a)=>{a!==t&&e.hasAttribute("data-open")&&e.toggleAttribute("data-open")})}
12t&&"1"==a&&f(),manipularTabIndex(r);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()}}
13document.querySelector("html").toggleAttribute("bc-core-burguer--body-toggled")}}
14if(d){var gs=document.querySelectorAll(d);gs.forEach((element)=>{if(!element.hasAttribute("tabindex")){element.setAttribute("tabindex","0")}
15element.addEventListener("click",function(){toggleBodyScroll();f()});element.addEventListener("keydown",function(event){if(event.key==="Enter"){toggleBodyScroll();f();event.stopImmediatePropagation()}})})}
16i.forEach((t)=>{1==parseFloat(t.querySelector("button").getAttribute("data-scroll"))&&(o=!0),t.addEventListener("click",function(){f()})}),window.location.href.includes("brickspreview")||(document.addEventListener("keydown",function(t){if("Escape"===t.key&&l&&closeOnEsc){f();if(document.querySelector("html").hasAttribute("bc-core-burguer--body-toggled")){document.querySelector("html").removeAttribute("bc-core-burguer--body-toggled")}}}),s&&s.addEventListener("click",function(){f();if(document.querySelector("html").hasAttribute("bc-core-burguer--body-toggled")){document.querySelector("html").removeAttribute("bc-core-burguer--body-toggled");if(window.lenisInstance){window.lenisInstance.start()}}})),e.querySelectorAll(".bc-multi-offcanvas-menu__subcanvas").forEach((t,a)=>{var o=t.getAttribute("data-opentoggle"),r=t.getAttribute("data-closetoggle");
16if(o==r&&o){document.querySelectorAll(o).forEach((o)=>{new MutationObserver(function(t){t.forEach((t)=>{"attributes"==t.type&&"data-open"==t.attributeName&&"bc-multi-offcanvas-menu--opened"===e.getAttribute("data-open")&&(o.classList.contains("bc-core-burguer")||o.setAttribute("tabindex","0"))})}).observe(e,{attributes:!0,attributeOldValue:!0}),o.addEventListener("mousedown",function(){event.preventDefault(),g(a),n.hasAttribute("data-open")?n.hasAttribute("data-open")&&t.hasAttribute("data-open")&&n.toggleAttribute("data-open"):n.toggleAttribute("data-open"),t.toggleAttribute("data-open"),c.forEach((e)=>{var a=e.querySelector("button");let o=`${a.classList[0]}--opened`,n=e;for(;n!==t&&n.parentNode;)n=n.parentNode;n===t?a.classList.toggle(o):a.classList.remove(o)})}),o.addEventListener("keydown",function(e){if("Enter"===e.key){g(a),n.hasAttribute("data-open")?t.hasAttribute("data-open")&&n.toggleAttribute("data-open"):n.toggleAttribute("data-open"),t.toggleAttribute("data-open");var o=t.querySelectorAll('a, button, [tabindex="0"], [contenteditable="true"], input, select, textarea');o.length>0&&o[0].focus(),c.forEach((e)=>{var a=e.querySelector("button");let o=`${a.classList[0]}--opened`,n=e;for(;n!==t&&n.parentNode;)n=n.parentNode;n!==t&&a.classList.remove(o)})}}),t.addEventListener("focusout",function(){o.focus()})})}else{if(o)
17document.querySelectorAll(o).forEach((o)=>{new MutationObserver(function(t){t.forEach((t)=>{"attributes"==t.type&&"data-open"==t.attributeName&&"bc-multi-offcanvas-menu--opened"===e.getAttribute("data-open")&&(o.classList.contains("bc-core-burguer")||o.setAttribute("tabindex","0"))})}).observe(e,{attributes:!0,attributeOldValue:!0}),o.addEventListener("mousedown",function(){event.preventDefault(),g(a),n.hasAttribute("data-open")||n.toggleAttribute("data-open"),t.hasAttribute("data-open")||t.toggleAttribute("data-open"),c.forEach((e)=>{var a=e.querySelector("button");let o=`${a.classList[0]}--opened`,n=e;for(;n!==t&&n.parentNode;)n=n.parentNode;n===t?a.classList.add(o):a.classList.remove(o)})}),o.addEventListener("keydown",function(e){if("Enter"===e.key){g(a),n.hasAttribute("data-open")||n.toggleAttribute("data-open"),t.hasAttribute("data-open")||t.toggleAttribute("data-open");var o=t.querySelectorAll('a, button, [tabindex="0"], [contenteditable="true"], input, select, textarea');o.length>0&&o[0].focus()}
18c.forEach((e)=>{var a=e.querySelector("button");let o=`${a.classList[0]}--opened`,n=e;for(;n!==t&&n.parentNode;)n=n.parentNode;n===t?a.classList.add(o):a.classList.remove(o)})}),t.addEventListener("focusout",function(){o.focus()})});r&&document.querySelectorAll(r).forEach((t)=>{new MutationObserver(function(a){a.forEach((a)=>{"attributes"==a.type&&"data-open"==a.attributeName&&"bc-multi-offcanvas-menu--opened"===e.getAttribute("data-open")&&t.setAttribute("tabindex","0")})}).observe(e,{attributes:!0,attributeOldValue:!0}),t.addEventListener("mousedown",function(){event.preventDefault(),p(),n.hasAttribute("data-open")&&n.toggleAttribute("data-open"),c.forEach((t)=>{var e=t.querySelector("button");let a=`${e.classList[0]}--opened`;e.classList.toggle(a)})}),t.addEventListener("keydown",function(t){"Enter"===t.key&&(p(),n.hasAttribute("data-open")&&n.toggleAttribute("data-open")),c.forEach((t)=>{var e=t.querySelector("button");let a=`${e.classList[0]}--opened`;e.classList.toggle(a)})})})}})})}
19document.addEventListener("DOMContentLoaded",function(t){bricksIsFrontend&&multioffcanvasmenu()})

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.