File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
classes/Visualizer/Module Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ public function renderChart( $atts ) {
252
252
$ actions_div .= '<a href="#" class="visualizer-action visualizer-action- ' . $ key . '" data-visualizer-type=" ' . $ key . '" data-visualizer-chart-id=" ' . $ atts ['id ' ] . '" data-visualizer-mime=" ' . $ mime . '" title=" ' . $ label . '" ' ;
253
253
254
254
if ( 'copy ' === $ key ) {
255
- $ copy = $ this ->_getDataAs ( $ atts ['id ' ], 'copy ' );
255
+ $ copy = $ this ->_getDataAs ( $ atts ['id ' ], 'csv ' );
256
256
$ actions_div .= ' data-clipboard-text=" ' . esc_attr ( $ copy ['csv ' ] ) . '" ' ;
257
257
}
258
258
Original file line number Diff line number Diff line change 232
232
} ) ;
233
233
234
234
function initActionsButtons ( ) {
235
- var clipboard = new Clipboard ( 'a.visualizer-action[data-visualizer-type=copy]' ) ; // jshint ignore:line
236
- clipboard . on ( 'success' , function ( e ) {
237
- window . alert ( v . i10n [ 'copied' ] ) ;
238
- } ) ;
239
-
235
+ if ( $ ( 'a.visualizer-action[data-visualizer-type=copy]' ) . length > 0 ) {
236
+ var clipboard = new Clipboard ( 'a.visualizer-action[data-visualizer-type=copy]' ) ; // jshint ignore:line
237
+ clipboard . on ( 'success' , function ( e ) {
238
+ window . alert ( v . i10n [ 'copied' ] ) ;
239
+ } ) ;
240
+ }
240
241
$ ( 'a.visualizer-action[data-visualizer-type!=copy]' ) . on ( 'click' , function ( e ) {
241
242
var type = $ ( this ) . attr ( 'data-visualizer-type' ) ;
242
243
var chart = $ ( this ) . attr ( 'data-visualizer-chart-id' ) ;
You can’t perform that action at this time.
0 commit comments