PageSourceSearch

https://aquatorya.ru/local/templates/sotbit_b2c/components/bitrix/menu/header_catalog_menu/script.min.js

js aquatorya.ru collected 2026-10-10 02:36:16 UTC 4,691 bytes, 2 lines download raw bytes

1BX.Sotbit.B2C.classes.HeaderCatalogMenu=class{isOpen=!1;overlay=null;constructor(e,t){this.data=e,this.params=t,this.menuBtns=document.querySelectorAll('[data-entity="header-menu-open-btn"]'),this.wrapper=document.querySelector('[data-entity="header-menu-wrapper"]'),this.levels=this.wrapper.querySelectorAll('[data-entity="menu-level"]'),this.addEventListeners()}open(){this.isOpen||(this.params.showOverlay&&(this.overlay=BX.Sotbit.B2C.showOverlay("header")),BX.Sotbit.B2C.showElement(this.wrapper,{duration:150}),BX.Sotbit.B2C.fixBodyScroll(),this.adjustPosition(),this.showLevel(1),this.menuBtns.forEach((e=>e.classList.add("active"))),this.isOpen=!0,BX.onCustomEvent("catalogMenuStateChange",{open:this.isOpen}))}close(){this.isOpen&&(this.overlay?.hide(),BX.Sotbit.B2C.hideElement(this.wrapper,{duration:150}),BX.Sotbit.B2C.unfixBodyScroll(),this.clearAllLevels(),this.menuBtns.forEach((e=>e.classList.remove("active"))),this.isOpen=!1,BX.onCustomEvent("catalogMenuStateChange",{open:this.isOpen}))}adjustPosition(){const e=getComputedStyle(document.body),t=BX.Sotbit.B2C.layout.header.container,[s,i,a]=t.children,l=i.getBoundingClientRect().height,o=BX.Sotbit.B2C.layout.header.isFixed?0:a?.getBoundingClientRect().height||0,n=s?.getBoundingClientRect(),r=n?.top>=0&&n?.height||0,h=parseInt(e.getPropertyValue("--safe-area-inset-bottom"))+(BX.Sotbit.B2C.isLaptop()?72:0);this.wrapper.style.top=`${l+o}px`,this.wrapper.style.height=window.innerHeight-(r+l+o)-h+"px"}showLevel(e,t){e=+e,BX.type.isNil(t)||(t=+t),this.clearUpToLevel(e),BX.Sotbit.B2C.isLaptop()&&this.levels.forEach((t=>{parseInt(t.dataset.depthLevel)!==e?t.classList.add("d-none"):t.classList.remove("d-none")})),BX.type.isNil(t)||this.levels[e-1].appendChild(this.createSectionHeader(t)),this.data.filter((s=>BX.type.isNil(t)?+s.DEPTH_LEVEL===e:+s.DEPTH_LEVEL===e&&+s.PARENT_INDEX===t)).forEach((t=>{this.levels[e-1].appendChild(this.createItem(t))}))}createSectionHeader(e){const t=this.data.find((t=>+t.ITEM_INDEX==+e)),s=BX.Sotbit.B2C.isLaptop()?BX.create("a",{props:{classList:"catalog-menu__link fw-bold fs-3",href:t.LINK,title:t.TEXT},text:t.TEXT}):BX.create("span",{props:{classList:"catalog-menu__link fw-bold fs-3"},html:`<span class="catalog-menu__item-title">${t.TEXT}</span>`});return BX.create("li",{props:{classList:"catalog-menu__item catalog-menu__item--header"},children:[BX.create("button",{props:{classList:"text-dark d-none d-lg-block"},html:`\n                        <svg style="transform: rotate(180deg)" class="me-4 flex-shrink-0" viewBox="0 0 16 16" width="16">\n                            <use xlink:href="${BX.Sotbit.B2C.templatePath}/assets/image/sprite.svg#arrow_menu"></use>\n                        </svg>\n                    `,events:{click:()=>{this.showLevel(+t.DEPTH_LEVEL,t.PARENT_INDEX?+t.PARENT_INDEX:null)}}}),s]})}createItem(e){const t={props:{classList:`catalog-menu__item ${e.IS_PARENT?"catalog-menu__item--parent":""} ${this.params.showImages&&1===e.DEPTH_LEVEL?"catalog-menu__item--image":""}`},dataset:{id:e.ITEM_INDEX},events:{mouseenter:()=>{BX.Sotbit.B2C.isLaptop()||(e.IS_PARENT?this.showLevel(+e.DEPTH_LEVEL+1,e.ITEM_INDEX):this.clearUpToLevel(+e.DEPTH_LEVEL+1))},click:t=>{BX.Sotbit.B2C.isLaptop()&&(e.IS_PARENT?(t.preventDefault(),t.stopPropagation(),this.showLevel(+e.DEPTH_LEVEL+1,e.ITEM_INDEX)):this.clearUpToLevel(+e.DEPTH_LEVEL+1))}},children:[BX.create("a",{props:{href:e.LINK,classList:"catalog-menu__link fw-medium",title:e.TEXT},children:[this.params.showImages&&1===e.DEPTH_LEVEL?BX.Sotbit.B2C.loadLazy(e.IMAGE,e.TEXT,{className:"img-contain"},{className:"catalog-menu__item-image"}):null,`<span class="catalog-menu__item-title">${e.TEXT}</span>`,e.IS_PARENT?`<svg class="catalog-menu__item-icon" viewBox="0 0 16 16" width="16">\n                                    <use xlink:href="${BX.Sotbit.B2C.templatePath}/assets/image/sprite.svg#arrow_menu"></use>\n                               </svg>`:null]})]};return BX.create("li",t)}clearLevel(e){[...this.levels[e-1].children].forEach((e=>e.remove()))}clearUpToLevel(e){for(;e<=this.params.maxDepth;
1)[...this.levels[e-1].children].forEach((e=>e.remove())),e++}clearAllLevels(){this.levels.forEach((e=>[...e.children].forEach((e=>e.remove()))))}addEventListeners(){document.addEventListener("click",(e=>{if(!this.isOpen)return;const t=[...this.menuBtns].find((t=>e.composedPath().includes(t)));e.composedPath().includes(this.wrapper)||t||this.close()})),window.addEventListener("resize",(()=>{this.isOpen&&this.adjustPosition(),BX.Sotbit.B2C.isLaptop()?(this.clearUpToLevel(2),this.isOpen&&this.close()):this.levels.forEach((e=>{e.classList.remove("d-none")}))}))}};
2//# sourceMappingURL=script.min.js.map

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.