File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 4
4
var vizClipboard1 = null ;
5
5
( function ( $ , visualizer ) {
6
6
7
+ // Once the facade is loaded, we need to refresh the charts. But we need to it one time only per chart.
8
+ var chartReloadedAfterFacade = [ ] ;
9
+
7
10
function initActionsButtons ( v ) {
8
11
if ( $ ( 'a.visualizer-chart-shortcode' ) . length > 0 && vizClipboard1 === null ) {
9
12
vizClipboard1 = new ClipboardJS ( 'a.visualizer-chart-shortcode' ) ; // jshint ignore:line
@@ -144,8 +147,13 @@ var vizClipboard1=null;
144
147
if ( $ ( element ) . is ( ':visible' ) ) {
145
148
var id = $ ( element ) . addClass ( 'viz-facade-loaded' ) . attr ( 'id' ) ;
146
149
showChart ( id ) ;
150
+
151
+ // Reload the chart and mark it as reloaded.
152
+ if ( chartReloadedAfterFacade . indexOf ( id ) === - 1 ) {
153
+ refreshEachCharts ( ) ;
154
+ chartReloadedAfterFacade . push ( id ) ;
155
+ }
147
156
}
148
- refreshEachCharts ( ) ;
149
157
} ) ;
150
158
151
159
// interate through all charts that are to be lazy-loaded and observe each one.
You can’t perform that action at this time.
0 commit comments