From 38e60f23be69984bec0b26958f10eff081d6fae2 Mon Sep 17 00:00:00 2001 From: Louis Croisez Date: Tue, 16 May 2023 23:34:42 +0200 Subject: [PATCH] correction bug in https://github.com/mcguirepr89/BirdNET-Pi/pull/898 --- scripts/overview.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/overview.php b/scripts/overview.php index 2f55b52..0132566 100644 --- a/scripts/overview.php +++ b/scripts/overview.php @@ -506,6 +506,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" @@ -615,6 +616,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; @@ -631,6 +633,7 @@ window.addEventListener('scroll', function() { // Loop through all chart elements and remove them charts.forEach(function(chart) { chart.parentNode.removeChild(chart); + window.chartWindow = undefined; }); });