From d2caa14766413aa45c6c0e5bb0bba243fd47d872 Mon Sep 17 00:00:00 2001 From: mirivlad Date: Sat, 14 Feb 2026 18:36:58 +0000 Subject: [PATCH] Fix tooltip visibility logic --- templates/servers/detail.twig | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/templates/servers/detail.twig b/templates/servers/detail.twig index 6f31d81..6ee6f85 100755 --- a/templates/servers/detail.twig +++ b/templates/servers/detail.twig @@ -519,17 +519,20 @@ new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, { tooltipEl.style.pointerEvents = 'none'; document.body.appendChild(tooltipEl); - // Hide tooltip on mouseleave - context.chart.canvas.addEventListener('mouseleave', function() { - tooltipEl.style.opacity = 0; - }); } var dataIndex = context.tooltip && context.tooltip.dataPoints && context.tooltip.dataPoints[0] ? context.tooltip.dataPoints[0].dataIndex : null; if (dataIndex === null) { tooltipEl.style.opacity = 0; + window.lastTooltipIndex = null; return; } + // Проверяем что курсор всё ещё над той же точкой + if (window.lastTooltipIndex && window.lastTooltipIndex !== dataIndex) { + tooltipEl.style.opacity = 0; + return; + } + window.lastTooltipIndex = dataIndex; var time = labels{{ metricName }}[dataIndex]; // Fetch processes