1/** 2 * VAT Tooltip Toggle 3 * Handles click toggle for VAT information tooltips 4 * Uses wrapper positioning for consistent tooltip placement 5 */ 6 7function toggleVatTooltip(icon) { 8 const tooltip = icon.nextElementSibling; 9 const allTooltips = document.querySelectorAll('.vat-tooltip'); 10 11 // Close all other tooltips 12 allTooltips.forEach(t => { 13 if (t !== tooltip) { 14 t.classList.remove('active'); 15 } 16 }); 17 18 // Toggle current tooltip 19 tooltip.classList.toggle('active'); 20 21 // Close tooltip when clicking outside 22 if (tooltip.classList.contains('active')) { 23 setTimeout(() => { 24 document.addEventListener('click', function closeTooltip(e) { 25 if (!icon.contains(e.target) && !tooltip.contains(e.target)) { 26 tooltip.classList.remove('active'); 27 document.removeEventListener('click', closeTooltip); 28 } 29 }); 30 }, 0); 31 } 32}
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.