mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Pager: Restore check for new headers. Fixes #1343
This commit is contained in:
parent
6032b121f3
commit
7528607eb4
@ -472,8 +472,8 @@
|
||||
}
|
||||
}
|
||||
p.processAjaxOnInit = true;
|
||||
// only add new header text if the length matches
|
||||
if ( th && th.length === hl ) {
|
||||
// update new header text
|
||||
if ( th ) {
|
||||
hsh = $table.hasClass('hasStickyHeaders');
|
||||
$sh = hsh ?
|
||||
c.widgetOptions.$sticky.children('thead:first').children('tr:not(.' + c.cssIgnoreRow + ')').children() :
|
||||
|
File diff suppressed because one or more lines are too long
2
dist/js/widgets/widget-pager.min.js
vendored
2
dist/js/widgets/widget-pager.min.js
vendored
File diff suppressed because one or more lines are too long
@ -774,36 +774,39 @@
|
||||
}
|
||||
}
|
||||
wo.pager_processAjaxOnInit = true;
|
||||
hsh = $table.hasClass( 'hasStickyHeaders' );
|
||||
$sh = hsh ?
|
||||
wo.$sticky.children( 'thead:first' ).children( 'tr:not(.' + c.cssIgnoreRow + ')' ).children() :
|
||||
'';
|
||||
$f = $table.find( 'tfoot tr:first' ).children();
|
||||
// don't change td headers (may contain pager)
|
||||
$headers = c.$headers.filter( 'th' );
|
||||
len = $headers.length;
|
||||
for ( j = 0; j < len; j++ ) {
|
||||
$h = $headers.eq( j );
|
||||
// add new test within the first span it finds, or just in the header
|
||||
if ( $h.find( '.' + ts.css.icon ).length ) {
|
||||
icon = $h.find( '.' + ts.css.icon ).clone( true );
|
||||
$h.find( '.' + ts.css.headerIn ).html( th[ j ] ).append( icon );
|
||||
if ( hsh && $sh.length ) {
|
||||
icon = $sh.eq( j ).find( '.' + ts.css.icon ).clone( true );
|
||||
$sh.eq( j ).find( '.' + ts.css.headerIn ).html( th[ j ] ).append( icon );
|
||||
}
|
||||
} else {
|
||||
$h.find( '.' + ts.css.headerIn ).html( th[ j ] );
|
||||
if ( hsh && $sh.length ) {
|
||||
// add sticky header to container just in case it contains pager controls
|
||||
p.$container = p.$container.add( wo.$sticky );
|
||||
$sh.eq( j ).find( '.' + ts.css.headerIn ).html( th[ j ] );
|
||||
// update new header text
|
||||
if ( th ) {
|
||||
hsh = $table.hasClass( 'hasStickyHeaders' );
|
||||
$sh = hsh ?
|
||||
wo.$sticky.children( 'thead:first' ).children( 'tr:not(.' + c.cssIgnoreRow + ')' ).children() :
|
||||
'';
|
||||
$f = $table.find( 'tfoot tr:first' ).children();
|
||||
// don't change td headers (may contain pager)
|
||||
$headers = c.$headers.filter( 'th' );
|
||||
len = $headers.length;
|
||||
for ( j = 0; j < len; j++ ) {
|
||||
$h = $headers.eq( j );
|
||||
// add new test within the first span it finds, or just in the header
|
||||
if ( $h.find( '.' + ts.css.icon ).length ) {
|
||||
icon = $h.find( '.' + ts.css.icon ).clone( true );
|
||||
$h.find( '.' + ts.css.headerIn ).html( th[ j ] ).append( icon );
|
||||
if ( hsh && $sh.length ) {
|
||||
icon = $sh.eq( j ).find( '.' + ts.css.icon ).clone( true );
|
||||
$sh.eq( j ).find( '.' + ts.css.headerIn ).html( th[ j ] ).append( icon );
|
||||
}
|
||||
} else {
|
||||
$h.find( '.' + ts.css.headerIn ).html( th[ j ] );
|
||||
if ( hsh && $sh.length ) {
|
||||
// add sticky header to container just in case it contains pager controls
|
||||
p.$container = p.$container.add( wo.$sticky );
|
||||
$sh.eq( j ).find( '.' + ts.css.headerIn ).html( th[ j ] );
|
||||
}
|
||||
}
|
||||
$f.eq( j ).html( th[ j ] );
|
||||
}
|
||||
if ( hsh ) {
|
||||
tsp.bindEvents( c );
|
||||
}
|
||||
$f.eq( j ).html( th[ j ] );
|
||||
}
|
||||
if (hsh) {
|
||||
tsp.bindEvents( c );
|
||||
}
|
||||
}
|
||||
if ( c.showProcessing ) {
|
||||
|
Loading…
Reference in New Issue
Block a user