mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Pager: Fix filtered regex
This commit is contained in:
parent
a02d264e2d
commit
7328732525
@ -341,12 +341,11 @@
|
||||
sz = p.size === 'all' ? p.totalRows : p.size,
|
||||
s = ( p.page * sz ),
|
||||
e = s + sz,
|
||||
f = c.widgetOptions && c.widgetOptions.filter_filteredRow || 'filtered',
|
||||
last = 0, // for cache indexing
|
||||
j = 0; // size counter
|
||||
p.cacheIndex = [];
|
||||
for ( i = 0; i < l; i++ ){
|
||||
if ( !rows[i].className.match(f) ) {
|
||||
if ( !p.regexFiltered.test(rows[i].className) ) {
|
||||
if (j === s && rows[i].className.match(c.cssChildRow)) {
|
||||
// hide child rows @ start of pager (if already visible)
|
||||
rows[i].style.display = 'none';
|
||||
@ -636,7 +635,7 @@
|
||||
count = f ? 0 : s;
|
||||
added = 0;
|
||||
while (added < e && index < rows.length) {
|
||||
if (!f || !/filtered/.test(rows[index][0].className)){
|
||||
if (!f || !p.regexFiltered.test(rows[index][0].className)){
|
||||
count++;
|
||||
if (count > s && added <= e) {
|
||||
added++;
|
||||
@ -940,6 +939,7 @@
|
||||
}
|
||||
// skipped rows
|
||||
p.regexRows = new RegExp('(' + (wo.filter_filteredRow || 'filtered') + '|' + c.selectorRemove.slice(1) + '|' + c.cssChildRow + ')');
|
||||
p.regexFiltered = new RegExp(wo.filter_filteredRow || 'filtered');
|
||||
|
||||
$t
|
||||
// .unbind( namespace ) adding in jQuery 1.4.3 ( I think )
|
||||
|
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
@ -190,6 +190,7 @@
|
||||
// skipped rows
|
||||
p.regexRows = new RegExp( '(' + ( wo.filter_filteredRow || 'filtered' ) + '|' +
|
||||
c.selectorRemove.slice( 1 ) + '|' + c.cssChildRow + ')' );
|
||||
p.regexFiltered = new RegExp( wo.filter_filteredRow || 'filtered' );
|
||||
|
||||
// clear initialized flag
|
||||
p.initialized = false;
|
||||
@ -637,7 +638,6 @@
|
||||
sz = p.size === 'all' ? p.totalRows : p.size,
|
||||
start = ( p.page * sz ),
|
||||
end = start + sz,
|
||||
filtr = wo && wo.filter_filteredRow || 'filtered',
|
||||
last = 0, // for cache indexing
|
||||
size = 0; // size counter
|
||||
p.cacheIndex = [];
|
||||
@ -648,7 +648,7 @@
|
||||
last = 0; // for cache indexing
|
||||
size = 0; // size counter
|
||||
for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
|
||||
if ( !$rows[ rowIndex ].className.match( filtr ) ) {
|
||||
if ( !p.regexFiltered.test( $rows[ rowIndex ].className ) ) {
|
||||
if ( size === start && $rows[ rowIndex ].className.match( c.cssChildRow ) ) {
|
||||
// hide child rows @ start of pager (if already visible)
|
||||
$rows[ rowIndex ].style.display = 'none';
|
||||
@ -949,7 +949,7 @@
|
||||
count = f ? 0 : s;
|
||||
added = 0;
|
||||
while ( added < e && index < rows.length ) {
|
||||
if ( !f || !/filtered/.test( rows[ index ][ 0 ].className ) ) {
|
||||
if ( !f || !p.regexFiltered.test( rows[ index ][ 0 ].className ) ) {
|
||||
count++;
|
||||
if ( count > s && added <= e ) {
|
||||
added++;
|
||||
|
Loading…
Reference in New Issue
Block a user