fix: улучшить делегирование mouseover на весь блок .uptime-segs для стабильных тултипов
Build and deploy / build-deploy (push) Has been cancelled

This commit is contained in:
2026-10-22 09:38:56 +00:00
parent f753826f9b
commit 59dfb5890f
+6 -3
View File
@@ -379,11 +379,14 @@ function escapeHtml(s) {
// Делегирование: тултип на весь контейнер сегментов. // Делегирование: тултип на весь контейнер сегментов.
document.addEventListener('mouseover', e => { document.addEventListener('mouseover', e => {
const seg = e.target.closest('.uptime-seg[data-seg]'); const seg = e.target.closest('.uptime-seg[data-seg]') || e.target.closest('.uptime-segs');
if (seg) showSegTip(seg); if (seg) {
const targetSeg = seg.classList.contains('uptime-seg') ? seg : seg.querySelector('.uptime-seg[data-seg]');
if (targetSeg) showSegTip(targetSeg);
}
}); });
document.addEventListener('mouseout', e => { document.addEventListener('mouseout', e => {
if (e.target.closest('.uptime-seg[data-seg]')) hideSegTip(); if (e.target.closest('.uptime-seg[data-seg]') || e.target.closest('.uptime-segs')) hideSegTip();
}); });
document.addEventListener('scroll', hideSegTip, true); document.addEventListener('scroll', hideSegTip, true);