1BX.Aspro.Utils.readyDOM(() => { 2 $(document).on("click", ".header-menu__wide-submenu-item-inner .toggle_block", function (e) { 3 e.preventDefault(); 4 5 var _this = $(this), 6 menu = _this.closest(".header-menu__wide-submenu-item-inner").find("> .submenu-wrapper"); 7 8 if (!_this.hasClass("clicked")) { 9 _this.addClass("clicked"); 10 11 menu.slideToggle(150, function () { 12 _this.removeClass("clicked"); 13 }); 14 15 _this.closest(".header-menu__wide-submenu-item-inner").toggleClass("opened"); 16 } 17 }); 18 19 BX.bindDelegate(document, 'click', {class: 'header-menu__link--only-catalog'}, function (e) { 20 e.preventDefault(); 21 22 const catalogButton = this; 23 const nodeSvgUse = catalogButton.querySelector('use'); 24 const svgLink = nodeSvgUse.getAttribute('xlink:href'); 25 26 27 if (catalogButton.classList.contains('opened')) { 28 catalogButton.classList.remove('opened'); 29 nodeSvgUse.setAttribute('xlink:href', svgLink.replace('#close', '#burger')); 30 } else { 31 catalogButton.classList.add('opened'); 32 nodeSvgUse.setAttribute('xlink:href', svgLink.replace('#burger', '#close')); 33 34 onlyCatalogMenuOpen($(catalogButton)); 35 } 36 37 onlyCatalogMenuClose(catalogButton); 38 }); 39 40 BX.bindDelegate(document, "click", {tag: 'body'}, function (e) { 41 const catalogButton = document.querySelector('.header-menu__link--only-catalog.opened'); 42 const isMenu = e.target.closest('.header-menu__wrapper'); 43 44 if (catalogButton && !isMenu) { 45 onlyCatalogMenuClose(); 46 } 47 }); 48 49 onlyCatalogMenuClose = function (currentButton = null) { 50 let nodeListCatalogButton = document.querySelectorAll('.header-menu__link--only-catalog.opened'); 51 if ( 52 !nodeListCatalogButton.length 53 || (nodeListCatalogButton.length === 1 && nodeListCatalogButton[0] === currentButton) 54 ) return; 55 56 nodeListCatalogButton.forEach(nodeCatalogButton => { 57 if (nodeCatalogButton !== currentButton) { 58 const currentSvg = nodeCatalogButton.querySelector('use'); 59 const currentSvgLink = currentSvg.getAttribute('xlink:href'); 60 nodeCatalogButton.classList.remove('opened'); 61 currentSvg.setAttribute('xlink:href', currentSvgLink.replace('#close', '#burger')); 62 } 63 }) 64 } 65 66 onlyCatalogMenuOpen = function (catalogButton) { 67 68 var menuNLO = catalogButton.siblings("[data-nlo]"); 69 if (menuNLO.length) { 70 if (!menuNLO.hasClass("nlo-loadings")) { 71 menuNLO.addClass("nlo-loadings"); 72 var menuCatalog = $(".header-menu__link--only-catalog ~ .header-menu__dropdown-menu"); 73 if(menuCatalog.length){ 74 menuNLO.replaceWith(menuCatalog.clone()); 75 catalogButton.parent().find('.aim-init').removeClass('aim-init'); 76 if (BX.Aspro.Utils.isFunction("InitMenuNavigationAim")) { 77 InitMenuNavigationAim(); 78 } 79 } else { 80 var buttonTitle = catalogButton.find(".header-menu__title"); 81 buttonTitle.addClass("loadings"); 82 $.ajax({ 83 data: { nlo: menuNLO.attr("data-nlo") }, 84 error: function () { 85 menuNLO.removeClass("nlo-loadings"); 86 }, 87 complete: function (jqXHR, textStatus) { 88 if (textStatus === "success" || jqXHR.status == 404) { 89 var ob = BX.processHTML($.trim(jqXHR.responseText)); 90 BX.ajax.processScripts(ob.SCRIPT); 91 menuNLO.replaceWith(ob.HTML); 92 if (BX.Aspro.Utils.isFunction("InitMenuNavigationAim")) { 93 InitMenuNavigationAim(); 94 } 95 } 96 buttonTitle.removeClass("loadings"); 97 }, 98 }); 99 } 100 } 101 } 102 }; 103 104 BX.addCustomEvent("onAjaxChangeWidgetValue", function (eventdata) { 105 if (eventdata && eventdata["NAME"] === "PAGE_WIDTH") { 106 if (BX.Aspro.Utils.isFunction("CheckTopMenuDotted")) { 107 CheckTopMenuDotted(); 108 } 109 } 110 }); 111 112});
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.