pager now updates with updateComplete event

This commit is contained in:
Mottie 2012-10-25 17:57:59 -05:00
parent 5a62860b47
commit 6d8fe95da8
5 changed files with 12 additions and 13 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
/*! /*!
* tablesorter pager plugin * tablesorter pager plugin
* updated 10/17/2012 * updated 10/25/2012
*/ */
/*jshint browser:true, jquery:true */ /*jshint browser:true, jquery:true */
;(function($) { ;(function($) {
@ -209,7 +209,7 @@
$sh = $t.find('.' + ((tc.widgetOptions && tc.widgetOptions.stickyHeaders) || 'tablesorter-stickyheader')); $sh = $t.find('.' + ((tc.widgetOptions && tc.widgetOptions.stickyHeaders) || 'tablesorter-stickyheader'));
$f = $t.find('tfoot tr:first').children(); $f = $t.find('tfoot tr:first').children();
$t.find('th.' + tc.cssHeader).each(function(j){ $t.find('th.' + tc.cssHeader).each(function(j){
var $t = $(this), tar, icn; var $t = $(this), icn;
// add new test within the first span it finds, or just in the header // add new test within the first span it finds, or just in the header
if ( $t.find('.' + tc.cssIcon).length ) { if ( $t.find('.' + tc.cssIcon).length ) {
icn = $t.find('.' + tc.cssIcon).clone(true); icn = $t.find('.' + tc.cssIcon).clone(true);
@ -248,7 +248,7 @@
getAjax = function(table, c){ getAjax = function(table, c){
var $t = $(table), var $t = $(table),
url = (c.ajaxUrl) ? c.ajaxUrl.replace(/\{page\}/g, c.page).replace(/\{size\}/g, c.size) : '', url = (c.ajaxUrl) ? c.ajaxUrl.replace(/\{page\}/g, c.page).replace(/\{size\}/g, c.size) : '',
k, arry = [], arry = [],
sl = table.config.sortList, sl = table.config.sortList,
col = url.match(/\{sortList[\s+]?:[\s+]?(.*)\}/); col = url.match(/\{sortList[\s+]?:[\s+]?(.*)\}/);
if (col) { if (col) {
@ -434,14 +434,14 @@
} }
// update pager after filter widget completes // update pager after filter widget completes
if ( $(table).hasClass('hasFilters') ) { $(table)
$(table).unbind('filterEnd.pager').bind('filterEnd.pager', function() { .unbind('filterEnd.pager updateComplete.pager ')
.bind('filterEnd.pager updateComplete.pager', function() {
c.page = 0; c.page = 0;
updatePageDisplay(table, c); updatePageDisplay(table, c);
moveToPage(table, c); moveToPage(table, c);
changeHeight(table, c); changeHeight(table, c);
}); });
}
if ( $(c.cssGoto, pager).length ) { if ( $(c.cssGoto, pager).length ) {
$(c.cssGoto, pager).bind('change', function(){ $(c.cssGoto, pager).bind('change', function(){

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*! /*!
* TableSorter 2.4.5 - Client-side table sorting with ease! * TableSorter 2.4.6 - Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
* Copyright (c) 2007 Christian Bach * Copyright (c) 2007 Christian Bach
@ -493,10 +493,9 @@
} }
function resortComplete($table, callback){ function resortComplete($table, callback){
var t = $table[0];
$table.trigger('updateComplete'); $table.trigger('updateComplete');
if (typeof callback === "function") { if (typeof callback === "function") {
callback(t); callback($table[0]);
} }
} }

File diff suppressed because one or more lines are too long