Make sure all HCs are initialized

Change-Id: I8c1ad0cc969805643ffcac1b822ae8ad32c3283e
diff --git a/inst/rmarkdown/templates/revealjs_presentation/resources/default.html b/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
index 9c9ee98..4c568f3 100644
--- a/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
+++ b/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
@@ -690,15 +690,12 @@
       makeFooterAndSlideNumberInvisibleOnTitlePage(event);
     });
 
-    hcChartsInitialized = false;
     Reveal.addEventListener('slidechanged', (event) => {
-      if(!hcChartsInitialized) {
-        Highcharts.charts.forEach((chart) => {
-        if(chart != null) {
-          chart.setSize(chart.chartWidth + 1, chart.chartHeight)
-        }});
+      Highcharts.charts.forEach((chart) => {
+      if(chart != null && chart.chartWidth == 900) {
+        chart.setSize(901, chart.chartHeight)
         hcChartsInitialized = true;
-      }
+      }});
       makeFooterAndSlideNumberInvisibleOnTitlePage(event);
     });
 </script>