dxpr_theme-5.0.1/js/minified/dxpr-theme-header.bundle.min.js

js/minified/dxpr-theme-header.bundle.min.js
!function(){var e={20:function(e){e.exports={setupMobileMenu:function(){document.getElementById("dxpr-theme-main-menu").style.display="none";var e=document.querySelector(".dxpr-theme-header--top");null==e||e.classList.add("dxpr-theme-header--side"),null==e||e.classList.remove("dxpr-theme-header--top"),document.querySelectorAll("#dxpr-theme-main-menu .menu .dropdown-menu, #dxpr-theme-main-menu .menu .dropdown-menu li").forEach((function(e){e.removeAttribute("style")}));var t=document.getElementById("dxpr-theme-main-menu");t&&t.querySelectorAll(".menu").forEach((function(e){e.classList.add("menu__level"),e.querySelectorAll(".dropdown-menu").forEach((function(e){e.classList.add("menu__level")})),e.querySelectorAll(".dxpr-theme-megamenu").forEach((function(e){e.classList.add("menu__level")})),e.querySelectorAll("a").forEach((function(e){e.classList.add("menu__link")})),e.querySelectorAll("li").forEach((function(e){e.classList.add("menu__item")}))})),document.querySelectorAll("#dxpr-theme-main-menu .menu a.dropdown-toggle").forEach((function(e){var t=e.nextElementSibling;e.setAttribute("data-submenu",e.textContent),t.setAttribute("data-menu",e.textContent)})),document.querySelectorAll("#dxpr-theme-main-menu .menu a.dxpr-theme-megamenu__heading").forEach((function(e){var t=e.nextElementSibling;e.setAttribute("data-submenu",e.textContent),t.setAttribute("data-menu",e.textContent)}));var n=document.querySelectorAll("#dxpr-theme-main-menu .menu .dropdown-menu").length>0,r=document.getElementById("dxpr-theme-main-menu");new MLMenu(r,{breadcrumbsCtrl:n,initialBreadcrumb:"menu",backCtrl:!1,itemsDelayInterval:10});var o=function(){"cross"===drupalSettings.dxpr_themeSettings.hamburgerAnimation&&document.querySelector("#dxpr-theme-menu-toggle").classList.toggle("navbar-toggle--active"),document.querySelector("#dxpr-theme-main-menu").classList.toggle("menu--open"),document.querySelector("html").classList.toggle("html--dxpr-theme-nav-mobile--open")};document.querySelector("#dxpr-theme-menu-toggle").addEventListener("click",(function(){o()})),document.getElementById("dxpr-theme-main-menu").style.position="fixed",document.getElementById("dxpr-theme-main-menu").style.display="block",document.querySelectorAll(".menu__link").forEach((function(e){e.addEventListener("click",(function(){this.getAttribute("data-submenu")||o()}))}))}}},134:function(e,t,n){var r=n(770).dxprThemeHit;e.exports={handleOverlayPosition:function(e){if(document.querySelectorAll("#secondary-header").length>0&&document.querySelectorAll("#navbar.dxpr-theme-header--overlay").length>0){var t=document.querySelector("#secondary-header").getBoundingClientRect(),n=document.querySelector("#navbar.dxpr-theme-header--overlay").getBoundingClientRect();if(r(n,t)){var o=document.querySelector("#navbar.dxpr-theme-header--overlay"),l=document.querySelector("#secondary-header");e.dxpr_themeSettings.secondHeaderSticky?(o.style.cssText="top:".concat(t.bottom,"px !important;"),l.classList.remove("dxpr-theme-secondary-header--sticky")):(document.querySelectorAll("#toolbar-bar").length>0?o.style.top="".concat(t.bottom,"px"):o.style.top="0",l.classList.remove("dxpr-theme-secondary-header--sticky"))}}}}},179:function(e,t,n){var r=n(770).dxprThemeCollisionCheck;e.exports={hitDetection:function(){var e=document.querySelector(".tabs--primary").getBoundingClientRect();if(document.querySelectorAll(".dxpr-theme-header--navbar-pull-down").length>0&&document.querySelectorAll("#navbar .container-col").length>0){var t=document.querySelector("#navbar .container-col").getBoundingClientRect();r(t,e)&&(document.querySelector(".tabs--primary").style.marginTop="".concat(t.bottom-e.top+6,"px"))}else{var n=document.querySelector("#navbar").getBoundingClientRect();r(n,e)&&(document.querySelector(".tabs--primary").style.marginTop="".concat(n.bottom-e.top+6,"px"))}}}},375:function(e){e.exports={dxpr_themeMenuOnResize:function(){"right"===drupalSettings.dxpr_themeSettings.headerSideDirection&&window.innerWidth<=window.dxpr_themeNavBreakpoint?document.querySelector(".dxpr-theme-main-menu").classList.add("dxpr-theme-main-menu--to-left"):document.querySelector(".dxpr-theme-main-menu").classList.remove("dxpr-theme-main-menu--to-left"),window.innerWidth>window.dxpr_themeNavBreakpoint&&0===document.querySelectorAll(".dxpr-theme-header--side").length&&(document.getElementById("dxpr-theme-main-menu").style.position="relative")}}},383:function(e){e.exports={setupStickyHeader:function(){var e=parseFloat(drupalSettings.dxpr_themeSettings.headerHeight),t=parseFloat(drupalSettings.dxpr_themeSettings.headerOffset);if(e&&t){var n=document.querySelector(".dxpr-theme-header--sticky"),r=document.getElementsByClassName("wrap-containers")[0];window.addEventListener("scroll",(function(){window.scrollY>=t?(n.classList.add("affix"),n.classList.remove("affix-top"),r.style.marginTop="".concat(e,"px")):(n.classList.add("affix-top"),n.classList.remove("affix"),r.style.marginTop="0")}))}}}},413:function(e){e.exports={adjustMenuPosition:function(){var e=0,t=document.querySelector(".wrap-branding");t&&(e=t.getBoundingClientRect().bottom);var n=document.querySelector("#dxpr-theme-main-menu .block:not(.block-menu):last-of-type");document.querySelectorAll(".body--dxpr-theme-header-side").length>0&&window.innerWidth>(window.dxpr_themeNavBreakpoint||1200)&&n&&e>0&&(document.getElementById("dxpr-theme-main-menu").style.paddingTop="".concat(e+40,"px"));var r=document.querySelector(".menu__breadcrumbs"),o=document.querySelector(".menu__level"),l=document.querySelector(".dxpr-theme-header--side .menu__level");if(n){var d=n.getBoundingClientRect().bottom;r&&(r.style.top="".concat(d+20,"px")),o&&(o.style.top="".concat(d+40,"px"));var a=40+d;l&&(l.style.height="calc(100vh - ".concat(a,"px)"))}else if(document.querySelectorAll(".body--dxpr-theme-header-side").length>0&&t&&e>120){r&&(r.style.top="".concat(e+20,"px")),o&&(o.style.top="".concat(e+40,"px"));var i=40+e;l&&(l.style.height="calc(100vh - ".concat(i,"px)"))}}}},546:function(e,t,n){"use strict";function r(e,t){var n,r,o,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=null,a=0,i=function(){a=!1===l.leading?0:Date.now(),d=null,o=e.apply(n,r),d||(n=null,r=null)};return function(){for(var r=arguments.length,u=new Array(r),c=0;c<r;c++)u[c]=arguments[c];var m=Date.now();a||!1!==l.leading||(a=m);var s=t-(m-a);return n=this,s<=0||s>t?(d&&(clearTimeout(d),d=null),a=m,o=e.apply(n,u),d||(n=null,u=null)):d||!1===l.trailing||(d=setTimeout(i,s)),o}}function o(e,t){var n,r=function(){for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];var d=this;clearTimeout(n),n=setTimeout((function(){return e.apply(d,o)}),t)};return r.cancel=function(){clearTimeout(n),n=null},r}function l(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return setTimeout((function(){return e.apply(void 0,r)}),t)}n.r(t),n.d(t,{debounce:function(){return o},delay:function(){return l},throttle:function(){return r}})},729:function(e){e.exports={dxpr_themeMenuGovernorBodyClass:function(){var e=1200;if("dxpr_themeNavBreakpoint"in window&&(e=window.dxpr_themeNavBreakpoint),window.innerWidth>e){var t=document.querySelector(".body--dxpr-theme-nav-mobile");t&&(t.classList.add("body--dxpr-theme-nav-desktop"),t.classList.remove("body--dxpr-theme-nav-mobile"))}else{var n=document.querySelector(".body--dxpr-theme-nav-desktop");n&&(n.classList.add("body--dxpr-theme-nav-mobile"),n.classList.remove("body--dxpr-theme-nav-desktop"))}}}},770:function(e){e.exports={dxprThemeCollisionCheck:function(e,t){return!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}}},784:function(e){e.exports={setupDesktopMenu:function(){var e=document.querySelector(".html--dxpr-theme-nav-mobile--open");null==e||e.classList.remove("html--dxpr-theme-nav-mobile--open");var t=document.querySelector(".dxpr-theme-header--side");t&&(t.classList.add("dxpr-theme-header--top"),t.classList.remove("dxpr-theme-header--side"));var n=document.querySelector("#dxpr-theme-main-menu .menu__breadcrumbs");null==n||n.remove();var r=document.querySelector(".menu__level");null==r||r.classList.remove("menu__level"),null==r||r.style.setProperty("top","100%"),null==r||r.style.setProperty("marginTop","0"),null==r||r.style.setProperty("height","auto");var o=document.querySelector(".menu__item");o&&o.classList.remove("menu__item"),document.querySelectorAll("[data-submenu]").forEach((function(e){return e.removeAttribute("data-submenu")})),document.querySelectorAll("[data-menu]").forEach((function(e){return e.removeAttribute("data-menu")}));var l=document.body.clientWidth;document.querySelectorAll("#dxpr-theme-main-menu .menu .dropdown-menu").forEach((function(e){e.parentElement.addEventListener("mouseenter",(function(){var t,n=e.offsetWidth,r=e.querySelectorAll(".dxpr-theme-megamenu__heading");if((t=r.length>0?r.length:Math.floor(e.querySelectorAll("li").length/8)+1)>2)e.style.width="100%",e.style.left="0",e.parentElement.style.position="static",e.querySelectorAll(".dropdown-menu > li").forEach((function(e){e.style.width="".concat(100/t,"%")}));else{t>1&&(e.style.minWidth="".concat(n*t+2,"px"),e.querySelectorAll(":scope > li").forEach((function(e){e.style.width="".concat(n,"px")})));var o=e.parentElement;setTimeout((function(){var t=Math.round(l-o.offsetLeft-e.offsetWidth-10);t<0&&(e.style.left="".concat(t,"px"))}),0)}}),{once:!0})}))}}},796:function(e){e.exports={applyFixedHeaderStyles:function(e){var t=document.querySelector("#navbar");document.querySelectorAll("#toolbar-bar").length>0&&t.classList.add("header-mobile-admin-fixed"),window.innerWidth>=975?t.classList.add("header-mobile-admin-fixed-active"):t.classList.remove("header-mobile-admin-fixed-active"),document.querySelector(".dxpr-theme-boxed-container").style.overflow="hidden",document.querySelector("#toolbar-bar").classList.add("header-mobile-fixed"),t.classList.add("header-mobile-fixed");var n=document.querySelector("#secondary-header");n&&(n.style.marginTop="".concat(e,"px"))}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r=n(383).setupStickyHeader,o=n(546).debounce,l=n(784).setupDesktopMenu,d=n(20).setupMobileMenu,a=n(179).hitDetection,i=n(134).handleOverlayPosition,u=n(413).adjustMenuPosition,c=n(796).applyFixedHeaderStyles,m=n(729).dxpr_themeMenuGovernorBodyClass,s=n(375).dxpr_themeMenuOnResize;!function(e,t){var n="",p="dxpr_themeNavBreakpoint"in window?window.dxpr_themeNavBreakpoint:1200;function h(e){var t=1200;if("dxpr_themeNavBreakpoint"in window&&(t=window.dxpr_themeNavBreakpoint),0===document.querySelectorAll(".body--dxpr-theme-header-side").length&&window.innerWidth>t){if("top"===n)return!1;l(),n="top",document.querySelectorAll(".tabs--primary").length>0&&document.querySelectorAll("#navbar").length>0&&a(),document.querySelectorAll("#secondary-header").length>0&&document.querySelectorAll("#navbar.dxpr-theme-header--overlay").length>0&&i(drupalSettings)}else{if("side"===n)return!1;d(),n="side",u()}}document.querySelectorAll(".dxpr-theme-header--sticky").length>0&&!document.querySelectorAll(".dxpr-theme-header--overlay").length&&window.innerWidth>p&&r();var y=drupalSettings.dxpr_themeSettings.headerMobileHeight,v=drupalSettings.dxpr_themeSettings.headerMobileFixed,x="dxpr_themeNavBreakpoint"in window?window.dxpr_themeNavBreakpoint:1200;v&&document.querySelectorAll(".dxpr-theme-header").length>0&&window.innerWidth<=x&&c(y),m(),window.addEventListener("resize",o((function(){document.querySelectorAll("#dxpr-theme-main-menu .nav").length>0&&(m(),h(document)),s()}),50)),s(),document.addEventListener("DOMContentLoaded",(function(){document.querySelector("#dxpr-theme-main-menu .nav")&&(m(),h(document))}))}(Drupal,once)}();

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc