Skip to content

A live bird collage card for your Home Assistant dashboard.

correction bug in https://github.com/mcguirepr89/BirdNET-Pi/pull/898

Louis Croisez38e60f23be69
diff --git a/scripts/overview.php b/scripts/overview.php
index 2f55b528..0132566d 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;
});
});