Skip to content

Commit

Permalink
Pager: stop using combined filter values. See #1363
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Mar 28, 2017
1 parent ea73edd commit 829e5a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion addons/pager/jquery.tablesorter.pager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
})
Expand Down
3 changes: 2 additions & 1 deletion js/widgets/widget-pager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
})
Expand Down

0 comments on commit 829e5a6

Please sign in to comment.