Skip to content

Commit 5454722

Browse files
remove scrollCollapse and work only on scrollY
1 parent db015de commit 5454722

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,16 @@ protected function _renderTableSettings() {
190190

191191
echo '<div class="viz-section-delimiter section-delimiter"></div>';
192192

193-
self::_renderCheckboxItem(
194-
esc_html__( 'Scroll Collapse', 'visualizer' ),
195-
'scrollCollapse_bool',
196-
$this->scrollCollapse_bool,
197-
'true',
198-
esc_html__( 'Allow the table to reduce in height when a limited number of rows are shown', 'visualizer' )
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+
)
199203
);
200204

201205
echo '<div class="viz-section-delimiter section-delimiter"></div>';

js/render-datatables.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@
5252
switch(v.page_type){
5353
case 'post':
5454
case 'library':
55+
// remove scrollY if its greater than what will fit in the box (along with the legend).
56+
if(parseInt(chart.settings['scrollY_int']) > 180){
57+
chart.settings['scrollY_int'];
58+
}
5559
$.extend( settings, {
5660
scrollX: 150,
5761
scrollY: 180,
58-
scrollCollapse: true
5962
} );
6063
break;
6164
case 'frontend':

0 commit comments

Comments
 (0)