1document.querySelectorAll('.tooltip').forEach(function(tooltip) { 2 const tooltipText = tooltip.querySelector('.tooltiptext'); 3 if (!tooltipText) return; 4 5 tooltip.addEventListener('mouseenter', function(e) { 6 // Hacemos visible para medir 7 tooltipText.style.visibility = 'hidden'; 8 tooltipText.style.display = 'block'; 9 tooltipText.style.opacity = '1'; 10 11 // Rectángulo del tooltip "base" 12 const rect = tooltip.getBoundingClientRect(); 13 const ttRect = tooltipText.getBoundingClientRect(); 14 15 // SIEMPRE debajo 16 let top = rect.bottom + 8; // 8px de margen debajo 17 let left = rect.left + (rect.width/2) - (ttRect.width/2); 18 19 // Si se sale por la izquierda o derecha, lo ajustamos a la ventana 20 if (left < 8) left = 8; 21 if (left + ttRect.width > window.innerWidth - 8) left = window.innerWidth - ttRect.width - 8; 22 23 // Posicionamos 24 tooltipText.style.left = left + 'px'; 25 tooltipText.style.top = top + 'px'; 26 27 tooltipText.style.visibility = 'visible'; 28 tooltipText.style.display = 'block'; 29 tooltipText.style.opacity = '1'; 30 }); 31 32 // Limpiamos al salir para no dejar el tooltip por ahà 33 tooltip.addEventListener('mouseleave', function() { 34 tooltipText.style.visibility = ''; 35 tooltipText.style.display = ''; 36 tooltipText.style.opacity = ''; 37 tooltipText.style.left = ''; 38 tooltipText.style.top = ''; 39 }); 40});
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.