Pager: restore first row in cacheIndex. Fixes #1714

This commit is contained in:
Rob Garrison 2020-03-03 04:10:00 -06:00
parent 6a32e5acc2
commit 3a7611c099
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
/*! /*!
* tablesorter (FORK) pager plugin * tablesorter (FORK) pager plugin
* updated 2018-08-27 (v2.31.0) * updated 2020-03-03 (v2.31.3)
*/ */
/*jshint browser:true, jquery:true, unused:false */ /*jshint browser:true, jquery:true, unused:false */
;(function($) { ;(function($) {
@ -367,7 +367,7 @@
sz = p.size === 'all' ? p.totalRows : p.size, sz = p.size === 'all' ? p.totalRows : p.size,
s = ( p.page * sz ), s = ( p.page * sz ),
e = s + sz, e = s + sz,
last = 0, // for cache indexing last = -1, // for cache indexing
j = 0; // size counter j = 0; // size counter
p.cacheIndex = []; p.cacheIndex = [];
for ( i = 0; i < l; i++ ) { for ( i = 0; i < l; i++ ) {

View File

@ -1,4 +1,4 @@
/*! Widget: Pager - updated 2018-08-27 (v2.31.0) */ /*! Widget: Pager - updated 2020-03-03 (v2.31.3) */
/* Requires tablesorter v2.8+ and jQuery 1.7+ /* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -665,14 +665,14 @@
sz = p.size === 'all' ? p.totalRows : p.size, sz = p.size === 'all' ? p.totalRows : p.size,
start = ( p.page * sz ), start = ( p.page * sz ),
end = start + sz, end = start + sz,
last = 0, // for cache indexing last = -1, // for cache indexing
size = 0; // size counter size = 0; // size counter
p.cacheIndex = []; p.cacheIndex = [];
for ( tbodyIndex = 0; tbodyIndex < tbodyLen; tbodyIndex++ ) { for ( tbodyIndex = 0; tbodyIndex < tbodyLen; tbodyIndex++ ) {
$rows = c.$tbodies.eq( tbodyIndex ).children( 'tr' ); $rows = c.$tbodies.eq( tbodyIndex ).children( 'tr' );
len = $rows.length; len = $rows.length;
lastIndex = 0; lastIndex = 0;
last = 0; // for cache indexing last = -1; // for cache indexing
size = 0; // size counter size = 0; // size counter
for ( rowIndex = 0; rowIndex < len; rowIndex++ ) { for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
if ( !p.regexFiltered.test( $rows[ rowIndex ].className ) ) { if ( !p.regexFiltered.test( $rows[ rowIndex ].className ) ) {