From 4003b6c0baf6a18c8cb539e9a8172afd604ddd55 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Mon, 14 Mar 2022 10:18:08 +0000 Subject: [PATCH] handled bug on resize concentration graph --- cara/apps/calculator/static/js/report.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cara/apps/calculator/static/js/report.js b/cara/apps/calculator/static/js/report.js index 64879a0f..23f41795 100644 --- a/cara/apps/calculator/static/js/report.js +++ b/cara/apps/calculator/static/js/report.js @@ -849,7 +849,11 @@ function draw_plot(svg_id, times, concentrations, short_range_concentrations, cu update_concentration_plot(short_range_concentrations, data_for_graphs.short_range_concentrations, data_for_graphs.short_range_concentrations); // Redraw based on the new size whenever the browser window is resized. - window.addEventListener("resize", redraw); + window.addEventListener("resize", e => { + redraw(); + update_concentration_plot(short_range_concentrations, data_for_graphs.short_range_concentrations, data_for_graphs.short_range_concentrations); + }); + }