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; }); });