PageSourceSearch

https://www.heidelbergmaterials.ba/themes/custom/hm/__prototype__/…/src/global-nav-megalayer.B4rNxzw1.js

js heidelbergmaterials.ba collected 2026-10-02 21:54:22 UTC 3,195 bytes, 1 lines download raw bytes

1(function(e){class t{constructor(e){this.$root=e,this.$sidebar=this.$root.querySelector(`.global-nav-megalayer-sidebar`),this.$sidebarInner=this.$root.querySelector(`.global-nav-megalayer-sidebar-inner`),this.$tabContentInner=this.$root.querySelector(`.global-nav-megalayer-content-inner`),this.$footerInner=this.$root.querySelector(`.global-nav-megalayer-footer-inner`),this.$items=this.$sidebar?this.$sidebar.querySelectorAll(`label, a`):[],this._activeItem=0,this.setup()}activateItem(e){e.setAttribute(`tabindex`,`0`),e instanceof HTMLLabelElement&&(e.classList.add(`is-active`),e.click(),this.adjustMaxHeight(this.$tabContentInner),this.adjustMaxHeight(this.$footerInner),this.adjustSidebar()),this.unsetItems(e)}unsetItems(e){this.$items.forEach(t=>{if(t!==e&&(t.setAttribute(`tabindex`,`-1`),t instanceof HTMLLabelElement)){t.classList.remove(`is-active`);let e=t.control;e instanceof HTMLInputElement&&e.type===`radio`&&(e.checked=!1)}})}hideOnFocusOut(e){e.preventDefault();let{relatedTarget:t}=e;this.$root.contains(t)||t?.classList.contains(`global-nav-item`)||this.$root.hidePopover()}handleItemClick(e){let t=e.currentTarget;(t instanceof HTMLAnchorElement||t instanceof HTMLLabelElement)&&this.activateItem(t)}focusNavigation(e,t){let{key:n}=t;switch(n){case`ArrowRight`:case`Right`:case`ArrowDown`:case`Down`:{t.preventDefault();let n=(e+1)%this.$items.length;this.activateItem(this.$items[n]),this.$items[n]instanceof HTMLElement&&this.$items[n].focus();break}case`ArrowLeft`:case`Left`:case`ArrowUp`:case`Up`:{t.preventDefault();let n=(e-1+this.$items.length)%this.$items.length;this.activateItem(this.$items[n]),this.$items[n]instanceof HTMLElement&&this.$items[n].focus();break}default:break}}adjustMaxHeight(e){if(!(e instanceof HTMLElement))return;let t=window.innerHeight,n=e.getBoundingClientRect().top,r=Math.max(64,t-n-64);e.style.maxHeight=`${r}px`}adjustSidebar(){let e=window.innerHeight,t=this.$sidebarInner?.getBoundingClientRect().top||0,n=this.$footerInner?.getBoundingClientRect().height||0,r=Math.max(64,e-t-n-104);this.$sidebarInner.style.maxHeight=`${r}px`}connectMegalayer(){this.activateItem(this.$items[0]),this.adjustMaxHeight(this.$tabContentInner),this.adjustMaxHeight(this.$footerInner),this.adjustSidebar(),window.addEventListener(`resize`,()=>{this.adjustMaxHeight(this.$tabContentInner),this.adjustMaxHeight(this.$footerInner),this.adjustSidebar()}),this.$root.addEventListener(`focusout`,this.hideOnFocusOut.bind(this)),this.$items.forEach((e,t)=>{e.addEventListener(`click`,this.handleItemClick.bind(this)),e.addEventListener(`keydown`,this.focusNavigation.bind(this,t))})}disconnectMegalayer(){this.$root&&(this.$root.removeEventListener(`focusout`,this.hideOnFocusOut.bind(this)),this.$items.forEach((e,t)=>{e.removeEventListener(`click`,this.handleItemClick.bind(this)),e.removeEventListener(`keydown`,this.focusNavigation.bind(this,t))}))}setup(){this.$root.addEventListener(`toggle`,e=>{let{newState:t}=e;t===`open`?this.connectMegalayer():this.disconnectMegalayer()})}}e.behaviors.globalNavMegalayer={attach(e){once(`global-nav-megalayer`,`[data-js="global-nav-megalayer"]`,e).forEach(e=>{e instanceof HTMLDivElement&&new t(e)})}}})(Drupal);

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.