mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Pager stays on same page after update. Fixes #590
This commit is contained in:
parent
d1426ad1c5
commit
9cabd1797a
@ -497,7 +497,6 @@
|
||||
}
|
||||
ts.processTbody(table, $tb, false);
|
||||
}
|
||||
|
||||
updatePageDisplay(table, p);
|
||||
if ( !p.isDisabled ) { fixHeight(table, p); }
|
||||
$t.trigger('applyWidgets');
|
||||
@ -695,15 +694,17 @@
|
||||
.unbind('filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize '.split(' ').join('.pager '))
|
||||
.bind('filterStart.pager', function(e, filters) {
|
||||
p.currentFilters = filters;
|
||||
if (p.pageReset !== false) {
|
||||
// don't change page is filters are the same (pager updating, etc)
|
||||
if (p.pageReset !== false && (c.lastCombinedFilter || '') !== (filters || []).join('')) {
|
||||
p.page = p.pageReset; // fixes #456 & #565
|
||||
}
|
||||
})
|
||||
// update pager after filter widget completes
|
||||
.bind('filterEnd.pager sortEnd.pager', function() {
|
||||
if (p.initialized) {
|
||||
moveToPage(table, p, false);
|
||||
// update page display first, so we update p.filteredPages
|
||||
updatePageDisplay(table, p, false);
|
||||
moveToPage(table, p, false);
|
||||
fixHeight(table, p);
|
||||
}
|
||||
})
|
||||
|
@ -214,15 +214,17 @@ tsp = ts.pager = {
|
||||
.unbind('filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize '.split(' ').join('.pager '))
|
||||
.bind('filterStart.pager', function(e, filters) {
|
||||
p.currentFilters = filters;
|
||||
if (wo.pager_pageReset !== false) {
|
||||
// don't change page is filters are the same (pager updating, etc)
|
||||
if (wo.pager_pageReset !== false && (c.lastCombinedFilter || '') !== (filters || []).join('')) {
|
||||
p.page = wo.pager_pageReset; // fixes #456 & #565
|
||||
}
|
||||
})
|
||||
// update pager after filter widget completes
|
||||
.bind('filterEnd.pager sortEnd.pager', function() {
|
||||
if (p.initialized) {
|
||||
tsp.moveToPage(table, p, false);
|
||||
// update page display first, so we update p.filteredPages
|
||||
tsp.updatePageDisplay(table, c, false);
|
||||
tsp.moveToPage(table, p, false);
|
||||
tsp.fixHeight(table, c);
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user