From 086fbf65a6fc8554b8a45f42b979b097c389b5a0 Mon Sep 17 00:00:00 2001 From: frederik Date: Sat, 16 Mar 2024 17:40:25 +0100 Subject: [PATCH] fix: minichart only worked first time --- scripts/todays_detections.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/todays_detections.php b/scripts/todays_detections.php index 78245a3..0045fbe 100644 --- a/scripts/todays_detections.php +++ b/scripts/todays_detections.php @@ -650,6 +650,7 @@ function generateMiniGraph(elem, comname) { // Create a div element for the chart window if (typeof(window.chartWindow) != 'undefined') { document.body.removeChild(window.chartWindow); + window.chartWindow = undefined; } var chartWindow = document.createElement('div'); chartWindow.className = "chartdiv" @@ -759,6 +760,7 @@ function generateMiniGraph(elem, comname) { closeButton.style.right = '5px'; closeButton.addEventListener('click', function() { document.body.removeChild(chartWindow); + window.chartWindow = undefined; }); chartWindow.appendChild(closeButton); window.chartWindow = chartWindow;