1"use strict"; 2 3function resizeMenuHeigth(idMenu) { 4 var menuWrapper = document.getElementById(idMenu); 5 var menuLevel1 = menuWrapper.querySelectorAll('.menu--item_column-nivel1:not(.noSub)'); 6 7 // hover no item do nivel 1 8 var _loop = function _loop(i) { 9 10 menuLevel1[i].addEventListener('mouseenter', function () { 11 12 // valores para quando existe resize da janela 13 var windowHeigth = window.innerHeight; 14 var menubottom = document.querySelector(".header__container"); 15 var areaMenu = menubottom.getBoundingClientRect(); 16 var dif = windowHeigth - areaMenu.bottom; 17 // Altura do container 18 var menuContainerHeight = menuLevel1[i].closest('.menu-item__items-container').offsetHeight; 19 // Altura do nivel 2 20 var menuLevel2Height = menuLevel1[i].nextSibling.offsetHeight; 21 22 // max heigth do nivel 2 igual a dif da janela 23 24 menuLevel1[i].nextSibling.style.maxHeight = parseInt(dif - 37) + "px"; 25 var newNivel2MaxHeigth = parseInt(menuLevel1[i].nextSibling.offsetHeight); 26 27 if(menuLevel2Height > menuLevel1[i].closest(".menu--item_column-content").offsetHeight) { 28 menuLevel1[i].closest('.menu-item__items-container').setAttribute('style', 'height:' + parseInt(newNivel2MaxHeigth + 27) + "px;"+ 'max-height:'+ parseInt(newNivel2MaxHeigth + 27) + "px;"); 29 } else if(menuLevel2Height < menuLevel1[i].closest(".menu--item_column-content").offsetHeight){ 30 menuLevel1[i].closest('.menu-item__items-container').removeAttribute('style'); 31 } 32 33 }); 34 35 menuLevel1[i].closest('.menu-item__items-container').addEventListener('mouseleave', function () { 36 menuLevel1[i].nextSibling.removeAttribute('style'); 37 }); 38}; 39 40 for (var i = 0; i < menuLevel1.length; i++) { 41 _loop(i); 42 } 43}
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.