|
6 | 6 |
|
7 | 7 | function initActionsButtons(v) {
|
8 | 8 | if($('a.visualizer-action[data-visualizer-type=copy]').length > 0) {
|
| 9 | + $('a.visualizer-action[data-visualizer-type=copy]').on('click', function(e) { |
| 10 | + e.preventDefault(); |
| 11 | + }); |
9 | 12 | var clipboard = new Clipboard('a.visualizer-action[data-visualizer-type=copy]'); // jshint ignore:line
|
10 | 13 | clipboard.on('success', function(e) {
|
11 | 14 | window.alert(v.i10n['copied']);
|
|
88 | 91 | document.body.dispatchEvent(event);
|
89 | 92 | };
|
90 | 93 |
|
91 |
| - // facade loads N times in the library (where N = the number of different chart libraries supported) |
| 94 | + // facade loads N times in the library and front end (where N = the number of different chart libraries supported) |
92 | 95 | // so all charts are also loaded N times
|
93 | 96 | // this will ensure that no matter how many times facade is loaded, it initializes all charts only once.
|
94 | 97 | // fixed as part of the issue to add annotations.
|
95 |
| - if(visualizer.page_type === 'library'){ |
96 |
| - if(localStorage.getItem( 'viz-facade-loaded' ) === '1'){ |
97 |
| - // prevent library from hanging. |
98 |
| - setTimeout( function(){ |
99 |
| - localStorage.removeItem( 'viz-facade-loaded' ); |
100 |
| - }, 2000); |
101 |
| - return; |
102 |
| - } |
103 |
| - localStorage.setItem( 'viz-facade-loaded', '1'); |
104 |
| - // remove the flag so that repeated loading of the library does not cause problems. |
| 98 | + if(localStorage.getItem( 'viz-facade-loaded' ) === '1'){ |
| 99 | + // prevent library from hanging. |
105 | 100 | setTimeout( function(){
|
106 | 101 | localStorage.removeItem( 'viz-facade-loaded' );
|
107 | 102 | }, 2000);
|
| 103 | + return; |
108 | 104 | }
|
| 105 | + localStorage.setItem( 'viz-facade-loaded', '1'); |
| 106 | + // remove the flag so that repeated loading of the library does not cause problems. |
| 107 | + setTimeout( function(){ |
| 108 | + localStorage.removeItem( 'viz-facade-loaded' ); |
| 109 | + }, 2000); |
| 110 | + |
109 | 111 | $('body').trigger('visualizer:render:chart:start', visualizer);
|
110 | 112 | initActionsButtons(visualizer);
|
111 | 113 | registerDefaultActions();
|
|
0 commit comments