From 4a3782f2287399b05ed0aa59c0ac8c921a21a5c3 Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Thu, 6 Sep 2018 17:39:33 +0200 Subject: [PATCH] deduplicate reloading; we already had an unused function for that --- web/static/seepark_web.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/web/static/seepark_web.js b/web/static/seepark_web.js index ff430ff..2aad39b 100644 --- a/web/static/seepark_web.js +++ b/web/static/seepark_web.js @@ -160,24 +160,9 @@ function dayschart(element, title, days, xtickformat) { }); // reload data in charts - // TODO: this is basically the same as the unused loaddays function below setInterval( function() { - if (element.substr(0, 7) == 'chart_w') { - console.log("water"); - chart.load({ - url: api_base_url_sensors + beginend(days), - mimeType: 'json' - }); - chart.flush(); - } else { - console.log("air"); - chart.load({ - url: api_base_url_weather + beginend(days), - mimeType: 'json' - }); - chart.flush(); - } + loaddays(chart, element, days); }, refresh_interval ); -- 2.47.3