File tree Expand file tree Collapse file tree 3 files changed +36
-12
lines changed Expand file tree Collapse file tree 3 files changed +36
-12
lines changed Original file line number Diff line number Diff line change @@ -190,12 +190,24 @@ protected function _renderTableSettings() {
190
190
191
191
echo '<div class="viz-section-delimiter section-delimiter"></div> ' ;
192
192
193
+ self ::_renderTextItem (
194
+ esc_html__ ( 'Table Height ' , 'visualizer ' ),
195
+ 'scrollY_int ' ,
196
+ isset ( $ this ->scrollY_int ) ? $ this ->scrollY_int : '' ,
197
+ esc_html__ ( 'Height of the table in pixels (the table will show a scrollbar). ' , 'visualizer ' ),
198
+ '' ,
199
+ 'number ' ,
200
+ array (
201
+ 'min ' => 0 ,
202
+ )
203
+ );
204
+
193
205
self ::_renderCheckboxItem (
194
- esc_html__ ( 'Scroll Collapse ' , 'visualizer ' ),
195
- 'scrollCollapse_bool ' ,
196
- $ this ->scrollCollapse_bool ,
206
+ esc_html__ ( 'Enable Horizontal Scrolling ' , 'visualizer ' ),
207
+ 'scrollX ' ,
208
+ $ this ->scrollX ,
197
209
'true ' ,
198
- esc_html__ ( 'Allow the table to reduce in height when a limited number of rows are shown ' , 'visualizer ' )
210
+ esc_html__ ( 'To disable wrapping of columns and enabling horizontal scrolling. ' , 'visualizer ' )
199
211
);
200
212
201
213
echo '<div class="viz-section-delimiter section-delimiter"></div> ' ;
Original file line number Diff line number Diff line change @@ -292,10 +292,6 @@ button.media-modal-close {
292
292
display : none !important ;
293
293
}
294
294
295
- .dataTables_scrollBody {
296
- overflow : hidden !important ;
297
- }
298
-
299
295
.dataTables_wrapper {
300
296
max-height : 300px ;
301
297
overflow : hidden !important ;
Original file line number Diff line number Diff line change 29
29
if ( $ ( '#' + id ) . find ( 'table.visualizer-data-table' ) . length > 0 ) {
30
30
$ ( '#' + id ) . empty ( ) ;
31
31
}
32
- $ ( '#' + id ) . append ( $ ( '<table class="dataTable visualizer-data-table table table-striped"></table>' ) ) ;
33
-
32
+
34
33
settings = {
35
34
destroy : true ,
36
35
paging : false ,
48
47
dom : 'Bfrtip' ,
49
48
} ;
50
49
50
+ var $classes = 'dataTable visualizer-data-table table table-striped' ;
51
+
51
52
if ( typeof v . page_type !== 'undefined' ) {
52
53
switch ( v . page_type ) {
53
54
case 'post' :
55
+ // fall-through.
54
56
case 'library' :
57
+ // remove scrollY if its greater than what will fit in the box (along with the legend).
58
+ if ( parseInt ( chart . settings [ 'scrollY_int' ] ) > 180 ) {
59
+ chart . settings [ 'scrollY_int' ] ;
60
+ }
61
+ delete chart . settings [ 'scrollX' ] ;
55
62
$ . extend ( settings , {
56
63
scrollX : 150 ,
57
64
scrollY : 180 ,
58
- scrollCollapse : true
59
65
} ) ;
60
66
break ;
61
- case 'frontend' :
62
67
case 'chart' :
68
+ delete chart . settings [ 'scrollX' ] ; // jshint ignore:line
69
+ // fall-through.
70
+ case 'frontend' :
63
71
// empty.
64
72
break ;
65
73
}
66
74
}
67
75
76
+ if ( typeof chart . settings [ 'scrollX' ] !== 'undefined' ) {
77
+ if ( chart . settings [ 'scrollX' ] == 'true' ) { // jshint ignore:line
78
+ $classes = $classes + ' nowrap' ;
79
+ }
80
+ }
81
+
82
+ $ ( '#' + id ) . append ( $ ( '<table class="' + $classes + '"></table>' ) ) ;
83
+
68
84
var select = {
69
85
info : false
70
86
} ;
You can’t perform that action at this time.
0 commit comments