removed setTimeout functions

This commit is contained in:
Rob Garrison 2012-03-22 10:03:24 -05:00
parent c680caab62
commit 0642f8e625
5 changed files with 46 additions and 26 deletions

View File

@ -34,6 +34,18 @@ Included all original [document pages](http://mottie.github.com/tablesorter/docs
View the [complete listing here](http://mottie.github.com/tablesorter/changelog.txt). View the [complete listing here](http://mottie.github.com/tablesorter/changelog.txt).
#### Version 2.1.6 (3/22/2012)
* Pager updates
* Updated pager css. It wasn't targeting the pager block correctly.
* Moved pager into the thead and/or tfoot in the <a href="example-pager-ajax.html">pager ajax demo</a>.
* The pager plugin ajax method should now only target the header column text (not the pager) and first footer row when updating the header text.
* Sticky Header widget &amp table css updated:
* Modified styles to add a border instead of using the row background; `border-spacing` css set to zero.
* Sticky header right edge should now align with the table.
* Removed top margin from IE so it will stick to the top of the browser window.
* Removed `setTimeout` functions. More details on why they were removed are [described here](http://wowmotty.blogspot.com/2011/06/jquery-tablesorter-missing-docs.html?showComment=1331768792441#c2353159245237432035).
#### Version 2.1.5 (3/20/2012) #### Version 2.1.5 (3/20/2012)
* The `isoDate` parser should now allow sorting of empty cells at the bottom. Fix for [issue #38](https://github.com/Mottie/tablesorter/issues/38). * The `isoDate` parser should now allow sorting of empty cells at the bottom. Fix for [issue #38](https://github.com/Mottie/tablesorter/issues/38).

View File

@ -1,5 +1,18 @@
TableSorter Change Log TableSorter Change Log
Version 2.1.6 (3/22/2012)
============================
* Pager updates
* Updated pager css. It wasn't targeting the pager block correctly.
* Moved pager into the thead and/or tfoot in the <a href="example-pager-ajax.html">pager ajax demo</a>.
* The pager plugin ajax method should now only target the header column text (not the pager) and first footer row when updating the header text.
* Sticky Header widget &amp table css updated:
* Modified styles to add a border instead of using the row background; `border-spacing` css set to zero.
* Sticky header right edge should now align with the table.
* Removed top margin from IE so it will stick to the top of the browser window.
* Removed `setTimeout` functions. More details on why they were removed are [described here](http://wowmotty.blogspot.com/2011/06/jquery-tablesorter-missing-docs.html?showComment=1331768792441#c2353159245237432035).
Version 2.1.5 (3/20/2012) Version 2.1.5 (3/20/2012)
============================ ============================

View File

@ -1,5 +1,5 @@
/*! /*!
* TableSorter 2.1.5 - Client-side table sorting with ease! * TableSorter 2.1.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
@ -18,7 +18,7 @@
$.extend({ $.extend({
tablesorter: new function(){ tablesorter: new function(){
this.version = "2.1.4"; this.version = "2.1.6";
var parsers = [], widgets = [], tbl; var parsers = [], widgets = [], tbl;
this.defaults = { this.defaults = {
@ -270,9 +270,7 @@
// apply table widgets // apply table widgets
applyWidget(table); applyWidget(table);
// trigger sortend // trigger sortend
setTimeout(function () {
$(table).trigger("sortEnd", table); $(table).trigger("sortEnd", table);
}, 0);
} }
// from: // from:
@ -556,7 +554,7 @@
if (!this.tHead || this.tBodies.length === 0) { return; } if (!this.tHead || this.tBodies.length === 0) { return; }
// declare // declare
var $this, $document, $headers, cache, config, shiftDown = 0, var $this, $document, $headers, cache, config, shiftDown = 0,
sortOrder, totalRows, $cell, c, i, j, a, s, o; sortOrder, totalRows, $cell, c, i, j, k, a, s, o;
// new blank config object // new blank config object
this.config = {}; this.config = {};
// merge and extend. // merge and extend.
@ -585,6 +583,7 @@
$this.trigger("sortStart", tbl[0]); $this.trigger("sortStart", tbl[0]);
// store exp, for speed // store exp, for speed
$cell = $(this); $cell = $(this);
k = !e[c.sortMultiSortKey];
// get current column sort order // get current column sort order
this.count = (this.count + 1) % (c.sortReset ? 3 : 2); this.count = (this.count + 1) % (c.sortReset ? 3 : 2);
// reset all sorts on non-current column - issue #30 // reset all sorts on non-current column - issue #30
@ -592,7 +591,7 @@
i = this; i = this;
$headers.each(function(){ $headers.each(function(){
// only reset counts on columns that weren't just clicked on and if not included in a multisort // only reset counts on columns that weren't just clicked on and if not included in a multisort
if (this !== i && (!$(this).is('.' + c.cssDesc + ',.' + c.cssAsc) || !e[c.sortMultiSortKey])) { if (this !== i && (k || !$(this).is('.' + c.cssDesc + ',.' + c.cssAsc))) {
this.count = -1; this.count = -1;
} }
}); });
@ -600,7 +599,7 @@
// get current column index // get current column index
i = this.column; i = this.column;
// user only wants to sort on one column // user only wants to sort on one column
if (!e[c.sortMultiSortKey]) { if (k) {
// flush the sort list // flush the sort list
c.sortList = []; c.sortList = [];
if (c.sortForce !== null) { if (c.sortForce !== null) {
@ -622,7 +621,7 @@
s = c.sortList[j]; s = c.sortList[j];
o = c.headerList[s[0]]; o = c.headerList[s[0]];
if (s[0] === i) { if (s[0] === i) {
s[1] = o.order[o.count]; // % (c.sortReset ? 3 : 2); s[1] = o.order[o.count];
if (s[1] === 2) { if (s[1] === 2) {
c.sortList.splice(j,1); c.sortList.splice(j,1);
o.count = -1; o.count = -1;
@ -644,11 +643,9 @@
} }
// sortBegin event triggered immediately before the sort // sortBegin event triggered immediately before the sort
$this.trigger("sortBegin", tbl[0]); $this.trigger("sortBegin", tbl[0]);
setTimeout(function () {
// set css for headers // set css for headers
setHeadersCss($this[0], $headers, c.sortList); setHeadersCss($this[0], $headers, c.sortList);
appendToTable($this[0], multisort($this[0], c.sortList, cache)); appendToTable($this[0], multisort($this[0], c.sortList, cache));
}, 1);
// stop normal event by returning false // stop normal event by returning false
return false; return false;
} }
@ -666,7 +663,6 @@
$this $this
.bind("update", function(){ .bind("update", function(){
var t = this, c = t.config; var t = this, c = t.config;
setTimeout(function(){
// remove rows/elements before update // remove rows/elements before update
$(c.selectorRemove, t.tBodies[0]).remove(); $(c.selectorRemove, t.tBodies[0]).remove();
// rebuild parsers. // rebuild parsers.
@ -674,7 +670,6 @@
// rebuild the cache map // rebuild the cache map
cache = buildCache(t); cache = buildCache(t);
$this.trigger("sorton", [t.config.sortList]); $this.trigger("sorton", [t.config.sortList]);
}, 1);
}) })
.bind("updateCell", function(e, cell) { .bind("updateCell", function(e, cell) {
// get position from the dom. // get position from the dom.

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "tablesorter", "name": "tablesorter",
"version": "2.1.4", "version": "2.1.6",
"title": "tablesorter", "title": "tablesorter",
"author": { "author": {
"name": "Christian Bach", "name": "Christian Bach",