Каталог файловtilda-menusub-1.0.js
701 borderColor += ', 0.25';702 borderColor = `rgba(${borderColor})`;703 }704 var bgWrapper = menu ? menu.querySelector('.t280__menu__bg, .t282__menu__wrapper') : null;705 var bgColor = '#000000';706 if (bgWrapper) {707 bgColor = getComputedStyle(bgWrapper).backgroundColor;708 } else if (menu) {709 bgColor = getComputedStyle(menu).backgroundColor;710 }711 submenu.style.backgroundColor = bgColor;712
История файла и сравнение версий
submenu.classList.add('t-menusub__menu--fullscreen');
713 submenu.style.height = document.documentElement.clientHeight + 'px'; 715 var submenuNav = document.createElement('div'); 716 submenuNav.classList.add('t-menusub__menu--fullscreen__nav'); 717 if (mainColor.indexOf('rgb') === 0) { 718 borderColor = mainColor.replace('rgb(', '').replace(')', ''); 719 borderColor += ', 0.6'; 720 borderColor = 'rgba(' + borderColor + ')'; 723 if (menu.classList.contains('t450__left') || menu.classList.contains('t451m__left')) { 724 submenu.classList.add('t-menusub__menu--fullscreen-left'); 727 submenuNav.style.borderBottom = '2px solid ' + borderColor; 728 var title = document.createElement('p'); 729 title.classList.add('t-menusub__menu--fullscreen__nav-title'); 730 title.textContent = hookLink.textContent; 731 title.style.color = mainColor; 732 title.style.fontWeight = hookLinkStyle.fontWeight; 733 title.style.fontSize = hookLinkStyle.fontSize; 734 title.style.textTransform = hookLinkStyle.textTransform; 735 var backArrow = document.createElement('div'); 736 backArrow.classList.add('t-menusub__menu--fullscreen__nav-arrow'); 737 backArrow.innerHTML = 738 '<svg class="tmain-submenu__close-icon" width="26px" height="26px"' + 739 ' viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg">\n' + 740 ' <path d="M10.4142136,5 L11.8284271,6.41421356 L5.829,12.414 ' + 741 'L23.4142136,12.4142136 L23.4142136,14.4142136 L5.829,14.414 L11.8284271,20.4142136 ' + 742 'L10.4142136,21.8284271 L2,13.4142136 L10.4142136,5 Z" fill="' + 746 submenuNav.appendChild(backArrow); 747 submenuNav.appendChild(title); 748 submenu.insertAdjacentElement('afterbegin', submenuNav); 749 if (rec) rec.insertAdjacentElement('beforeend', submenu); 752 window.addEventListener('orientationchange', function () { 753 setTimeout(function () { 754 Array.prototype.forEach.call(document.querySelectorAll('.t-menusub__menu--fullscreen'), function (submenu) { 755 submenu.style.height = document.documentElement.clientHeight + 'px'; 757 }, MENU_TRANSITION_DURATION); 761function t_menusub__createArrowCustomPos(submenu, position) { 762 submenu.classList.add('t-menusub__menu-custompos'); 763 submenu.style.setProperty('--custom-pos', position + 'px'); 767 * getBoundingClientRect().left may be incorrect working in IE; this function need for prevent it 769 * @param {HTMLElement} el - current Element 770 * @returns {number} - number of relative left position 772function t_menusub__getLeftRelativePos(el) { 774 var parentOffsetLeft = 0; 776 // Элементы с position:fixed смещены относительно viewport, который всегда имеет нулевое смещение 777 if (window.getComputedStyle(el).getPropertyValue('position') === 'fixed') { 778 offsetLeft = el.getBoundingClientRect().left; 780 offsetLeft = el.getClientRects().length ? el.getBoundingClientRect().left : 0; 781 var offsetParent = el.offsetParent; 784 offsetParent.nodeType === 1 && 785 window.getComputedStyle(offsetParent).getPropertyValue('position') === 'static' 787 offsetParent = offsetParent.offsetParent; 789 if (offsetParent && offsetParent !== el && offsetParent.nodeType === 1) { 790 parentOffsetLeft = offsetParent.getClientRects().length ? offsetParent.getBoundingClientRect().left : 0; 793 return offsetLeft - parentOffsetLeft; 797 * @param {HTMLElement} submenu - second level menu block (.t-menusub) 798 * @returns {false} - if wrapME401 is cannot find from submenu 800function t_menusub__hideSubmenu(submenu) {