Scroller: tweak code from #1165. Fixes #907

This commit is contained in:
Rob Garrison 2016-02-24 21:31:49 -06:00
parent c391287ce2
commit 8c99112332
3 changed files with 10 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -330,7 +330,12 @@ $(function() {
<tr id="scroller-height"> <tr id="scroller-height">
<td><span class="permalink">scroller_height</span></td> <td><span class="permalink">scroller_height</span></td>
<td>300</td> <td>300</td>
<td>Set the height of the scroll window in pixels.</td> <td>Set the height of the scroll window in pixels (<span class="version">v2.25.5</span>)
<div class="collapsible">
<br>
As of <span class="version">v2.25.5</span>, setting this option to an empty string or zero will make the scroller full height.
</div>
</td>
</tr> </tr>
<tr id="scroller-bar-width"> <tr id="scroller-bar-width">

View File

@ -186,7 +186,7 @@
}, },
setup : function( c, wo ) { setup : function( c, wo ) {
var maxHt, tbHt, $hdr, $t, $hCells, $fCells, $tableWrap, events, tmp, detectedWidth, var tbHt, $hdr, $t, $hCells, $fCells, $tableWrap, events, tmp, detectedWidth,
$win = $( window ), $win = $( window ),
tsScroller = ts.scroller, tsScroller = ts.scroller,
namespace = c.namespace + 'tsscroller', namespace = c.namespace + 'tsscroller',
@ -211,7 +211,6 @@
wo.scroller_barSetWidth = detectedWidth !== null ? detectedWidth : 15; wo.scroller_barSetWidth = detectedWidth !== null ? detectedWidth : 15;
} }
maxHt = wo.scroller_height || 300;
tmp = $table.children( 'caption' ); tmp = $table.children( 'caption' );
$hdr = $( '<table class="' + $table.attr( 'class' ) + '" cellpadding=0 cellspacing=0>' + $hdr = $( '<table class="' + $table.attr( 'class' ) + '" cellpadding=0 cellspacing=0>' +
@ -251,12 +250,8 @@
// if max-height is greater than 0 use max-height, so the height resizes dynamically while filtering // if max-height is greater than 0 use max-height, so the height resizes dynamically while filtering
// else let the table not have a vertical scroll // else let the table not have a vertical scroll
if(maxHt > 0){ $table.wrap( '<div class="' + tscss.scrollerTable +
$table.wrap( '<div class="' + tscss.scrollerTable + '" style="max-height:' + maxHt + 'px;" />' ); ( wo.scroller_height > 0 ? '" style="max-height:' + wo.scroller_height + 'px;">' : '">' ) );
}
else {
$table.wrap( '<div class="' + tscss.scrollerTable + '" />' );
}
$tableWrap = $table.parent(); $tableWrap = $table.parent();
// make scroller header sortable // make scroller header sortable