Pager: stop using combined filter values. See #1363

This commit is contained in:
Rob Garrison 2017-03-28 14:21:58 -05:00
parent ea73eddab8
commit 829e5a62b5
2 changed files with 6 additions and 2 deletions

View File

@ -967,7 +967,10 @@
.bind('filterInit filterStart '.split(' ').join(namespace + ' '), function(e, filters) {
p.currentFilters = $.isArray(filters) ? filters : c.$table.data('lastSearch');
// don't change page if filters are the same (pager updating, etc)
if (e.type === 'filterStart' && p.pageReset !== false && (c.lastCombinedFilter || '') !== (p.currentFilters || []).join('')) {
if (
e.type === 'filterStart' &&
p.pageReset !== false &&
(c.lastSearch || []).join(',') !== (p.currentFilters || []).join(',')) {
p.page = p.pageReset; // fixes #456 & #565
}
})

View File

@ -252,7 +252,8 @@
p.currentFilters = $.isArray( filters ) ? filters : c.$table.data( 'lastSearch' );
// don't change page if filters are the same (pager updating, etc)
if ( e.type === 'filterStart' && wo.pager_pageReset !== false &&
( c.lastCombinedFilter || '' ) !== ( p.currentFilters || [] ).join( '' ) ) {
( c.lastSearch || [] ).join( ',' ) !== ( p.currentFilters || [] ).join( ',' )
) {
p.page = wo.pager_pageReset; // fixes #456 & #565
}
})