From 7f953e989e59e87686cb985ca5d48d3aed3184b1 Mon Sep 17 00:00:00 2001 From: Risto Lahtela <24460436+Rsl1122@users.noreply.github.com> Date: Sun, 31 Jan 2021 12:24:35 +0200 Subject: [PATCH] Fixed night mode not applying to query graphs Issue was that HighCharts was too late in the load order to apply color-selector.js method --- .../resources/assets/plan/web/js/color-selector.js | 1 + .../src/main/resources/assets/plan/web/js/query.js | 3 +++ .../src/main/resources/assets/plan/web/query.html | 12 ++++++------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Plan/common/src/main/resources/assets/plan/web/js/color-selector.js b/Plan/common/src/main/resources/assets/plan/web/js/color-selector.js index 355bab248..ae3d45a3e 100644 --- a/Plan/common/src/main/resources/assets/plan/web/js/color-selector.js +++ b/Plan/common/src/main/resources/assets/plan/web/js/color-selector.js @@ -468,6 +468,7 @@ Highcharts.setOptions(Highcharts.theme); updateGraphs(); } catch (e) { + if (graphs !== undefined) console.error(e); } } diff --git a/Plan/common/src/main/resources/assets/plan/web/js/query.js b/Plan/common/src/main/resources/assets/plan/web/js/query.js index 506d30e8a..c02051ce0 100644 --- a/Plan/common/src/main/resources/assets/plan/web/js/query.js +++ b/Plan/common/src/main/resources/assets/plan/web/js/query.js @@ -389,6 +389,9 @@ function displayDataResultScreen(resultCount, view) { const beforeDate = queryState.view.beforeDate ? queryState.view.beforeDate : view.beforeDate; const afterTime = queryState.view.afterTime ? queryState.view.afterTime : view.afterTime; const beforeTime = queryState.view.beforeTime ? queryState.view.beforeTime : view.beforeTime; + + graphs.splice(0, graphs.length); // Remove view graph from state as it is removed from DOM + document.querySelector('#content .tab').innerHTML = `