Scroller: Move caption to cloned thead. Fixes #1141

This commit is contained in:
Rob Garrison 2016-02-18 07:55:15 -06:00
parent 268706acbe
commit 61f38b81b1
2 changed files with 6 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -214,6 +214,7 @@
maxHt = wo.scroller_height || 300; maxHt = wo.scroller_height || 300;
$hdr = $( '<table class="' + $table.attr( 'class' ) + '" cellpadding=0 cellspacing=0>' + $hdr = $( '<table class="' + $table.attr( 'class' ) + '" cellpadding=0 cellspacing=0>' +
$table.children( 'caption' )[ 0 ].outerHTML +
$table.children( 'thead' )[ 0 ].outerHTML + '</table>' ); $table.children( 'thead' )[ 0 ].outerHTML + '</table>' );
wo.scroller_$header = $hdr.addClass( c.namespace.slice( 1 ) + '_extra_table' ); wo.scroller_$header = $hdr.addClass( c.namespace.slice( 1 ) + '_extra_table' );
@ -260,9 +261,8 @@
} }
$table $table
.find( 'thead' ) .children( 'thead, caption' )
.addClass( tscss.scrollerHideElement ); .addClass( tscss.scrollerHideElement );
tbHt = $tableWrap.parent().height(); tbHt = $tableWrap.parent().height();
// The header will always jump into view if scrolling the table body // The header will always jump into view if scrolling the table body
@ -444,7 +444,7 @@
.width( setWidth + temp ); .width( setWidth + temp );
// hide original table thead // hide original table thead
$table.children( 'thead' ).addClass( tscss.scrollerHideElement ); $table.children( 'thead, caption' ).addClass( tscss.scrollerHideElement );
// update fixed column sizes // update fixed column sizes
tsScroller.updateFixed( c, wo ); tsScroller.updateFixed( c, wo );
@ -479,6 +479,8 @@
.removeClass( tscss.scrollerWrap ) .removeClass( tscss.scrollerWrap )
.attr( 'id', '' ); .attr( 'id', '' );
$fixedColumn.find('caption').html('&nbsp;');
if ( wo.scroller_addFixedOverlay ) { if ( wo.scroller_addFixedOverlay ) {
$fixedColumn.append( '<div class="' + tscss.scrollerFixedPanel + '">' ); $fixedColumn.append( '<div class="' + tscss.scrollerFixedPanel + '">' );
} }