mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
StickyHeaders: Include caption height in calculations. Fixes #1205
This commit is contained in:
parent
a7abfa4e11
commit
0ad959531c
2
dist/js/widgets/widget-stickyHeaders.min.js
vendored
2
dist/js/widgets/widget-stickyHeaders.min.js
vendored
File diff suppressed because one or more lines are too long
@ -58,7 +58,8 @@ Note:
|
||||
|
||||
<!-- Tablesorter script: required -->
|
||||
<script src="../js/jquery.tablesorter.js"></script>
|
||||
<script src="../js/jquery.tablesorter.widgets.js"></script>
|
||||
<script src="../js/widgets/widget-filter.js"></script>
|
||||
<script src="../js/widgets/widget-stickyHeaders.js"></script>
|
||||
|
||||
<script id="js">$(function(){
|
||||
|
||||
|
@ -162,12 +162,14 @@
|
||||
var offset = $table.offset(),
|
||||
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
|
||||
xWindow = $.isWindow( $xScroll[0] ),
|
||||
// scrollTop = ( $attach.length ? $attach.offset().top : $yScroll.scrollTop() ) + stickyOffset + nestedStickyTop,
|
||||
scrollTop = ( $attach.length ? ( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) : $yScroll.scrollTop() ) + stickyOffset + nestedStickyTop,
|
||||
tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)),
|
||||
attachTop = $attach.length ?
|
||||
( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) :
|
||||
$yScroll.scrollTop(),
|
||||
captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0,
|
||||
scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight,
|
||||
tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight,
|
||||
isVisible = ( scrollTop > offset.top ) && ( scrollTop < offset.top + tableHeight ) ? 'visible' : 'hidden',
|
||||
cssSettings = { visibility : isVisible };
|
||||
|
||||
if ($attach.length) {
|
||||
cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user