fix issue #21 - apply widgets once

This commit is contained in:
Rob Garrison 2012-01-30 09:58:58 -06:00
parent 13ee3d5642
commit 14c0e39b03
2 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,6 @@
/* /*
* TableSorter 2.0 - Client-side table sorting with ease! * TableSorter 2.0 - Client-side table sorting with ease!
* Version 2.0.25 * Version 2.0.26
* @requires jQuery v1.2.3 * @requires jQuery v1.2.3
* *
* Copyright (c) 2007 Christian Bach * Copyright (c) 2007 Christian Bach
@ -523,7 +523,7 @@
dynamicExp += "return 0; "; dynamicExp += "return 0; ";
dynamicExp += "}; "; dynamicExp += "}; ";
eval(dynamicExp); eval(dynamicExp);
cache.normalized.sort(sortWrapper); cache.normalized.sort(sortWrapper); // sort using eval expression
if (tc.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); } if (tc.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); }
return cache; return cache;
} }
@ -772,9 +772,10 @@
// if user has supplied a sort list to constructor. // if user has supplied a sort list to constructor.
if (config.sortList.length > 0) { if (config.sortList.length > 0) {
$this.trigger("sorton", [config.sortList]); $this.trigger("sorton", [config.sortList]);
} } else {
// apply widgets // apply widgets
applyWidget(this); applyWidget(this);
}
}); });
}; };
this.addParser = function(parser) { this.addParser = function(parser) {

File diff suppressed because one or more lines are too long