Skip to content

Commit 4c425fc

Browse files
prevent initialization of charts twice
1 parent 2449a40 commit 4c425fc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

js/render-facade.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@
8181
}
8282

8383
$(document).ready(function(){
84+
// facade loads twice in the admin area, so all charts are also loaded twice
85+
// this will ensure that even if it loaded twice, it initializes all charts only once.
86+
// fixed as part of the issue to add annotations.
87+
if(localStorage.getItem( 'viz-facade-loaded' ) === '1'){
88+
localStorage.removeItem( 'viz-facade-loaded' );
89+
return;
90+
}
91+
localStorage.setItem( 'viz-facade-loaded', '1');
8492
$('body').trigger('visualizer:render:chart:start', visualizer);
8593
initActionsButtons(visualizer);
8694
registerDefaultActions();

0 commit comments

Comments
 (0)