PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.2.1
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.2.1
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | js/render-datatables.js +25 -1 3.1.13.2.1 View file →
@@ -2,8 +2,10 @@
2 2 /* global visualizer */
3 3
4 4 (function($) {
5 5 var all_charts;
6 + // so that we know which charts belong to our library.
7 + var rendered_charts = [];
6 8
7 9 function renderChart(id, v) {
8 10 renderSpecificChart(id, all_charts[id], v);
9 11 }
@@ -13,8 +15,9 @@
13 15
14 16 if(chart.library !== 'datatables'){
15 17 return;
16 18 }
19 + rendered_charts[id] = 'yes';
17 20
18 21 series = chart.series;
19 22 data = chart.data;
20 23
@@ -34,8 +37,16 @@
34 37 searching: false,
35 38 ordering: true,
36 39 select: false,
37 40 lengthChange: false,
41 + buttons: {
42 + buttons: [{
43 + extend: 'print',
44 + text: '',
45 + title: ''
46 + }]
47 + },
48 + dom: 'Bfrtip',
38 49 };
39 50
40 51 if(typeof v.page_type !== 'undefined'){
41 52 switch(v.page_type){
@@ -56,9 +67,10 @@
56 67
57 68 var select = {
58 69 info: false
59 70 };
60 - $.extend( settings, { select } ); // jshint ignore:line
71 + // we cannot use { select } below because https://github.com/Codeinwp/visualizer/issues/357
72 + $.extend( settings, { info: false } ); // jshint ignore:line
61 73
62 74 var stripe = ['', ''];
63 75
64 76 // in preview mode, cssClassNames will not exist when a color is changed.
@@ -215,8 +227,20 @@
215 227 $('body').on('visualizer:render:specificchart:start', function(event, v){
216 228 renderSpecificChart(v.id, v.chart, v.v);
217 229 });
218 230
231 + // front end actions
232 + $('body').on('visualizer:action:specificchart', function(event, v){
233 + switch(v.action){
234 + case 'print':
235 + var id = v.id;
236 + if(typeof rendered_charts[id] === 'undefined'){
237 + return;
238 + }
239 + $('#' + id + ' .buttons-print').trigger('click');
240 + break;
241 + }
242 + });
219 243
220 244 })(jQuery);
221 245
222 246