diff --git a/README.markdown b/README.markdown
index 346071b5..6253c34a 100644
--- a/README.markdown
+++ b/README.markdown
@@ -34,6 +34,23 @@ Included all original [document pages](http://mottie.github.com/tablesorter/docs
View the [complete listing here](http://mottie.github.com/tablesorter/changelog.txt).
+#### Version 2.1.7 (3/26/2012)
+
+* Changed default css options to use more unique names:
+ * `cssHeader` is now `"tablesorter-header"`
+ * `cssAsc` is now `"tablesorter-headerSortUp"`
+ * `cssDesc` is now `"tablesorter-headerSortDown"`
+ * Updated blue & green styles to use the appropriate names.
+ * Left the original css definitions to keep the styles backward compatible.
+* Table header cell content wrapper modification:
+ * Previously the content was wrapped with a `span`, now wrapped with a `div`
+ * Content wrapping div now as the class name of `tablesorter-header-inner` applied to it.
+* Various widget fixes:
+ * The `$.tablesorter.storage` code now loads saved variables before updating. Fix for [issue #41](https://github.com/Mottie/tablesorter/issues/41).
+ * Reverted the "filter" widget code to work like it is supposed to. Fix for [issue #40](https://github.com/Mottie/tablesorter/issues/40).
+ * Modified the "stickHeaders" widget to now set the width of the content instead of the table cell. It seems to work better. Fix for [issue #37](https://github.com/Mottie/tablesorter/issues/37)
+ * Fixed the "uitheme" widget code to update the sorting icon correctly.
+
#### Version 2.1.6 (3/22/2012)
* Pager updates
diff --git a/changelog.txt b/changelog.txt
index f2ce2552..8ca210a4 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,5 +1,23 @@
TableSorter Change Log
+Version 2.1.7 (3/26/2012)
+============================
+
+* Changed default css options to use more unique names:
+ * `cssHeader` is now `"tablesorter-header"`
+ * `cssAsc` is now `"tablesorter-headerSortUp"`
+ * `cssDesc` is now `"tablesorter-headerSortDown"`
+ * Updated blue & green styles to use the appropriate names.
+ * Left the original css definitions to keep the styles backward compatible.
+* Table header cell content wrapper modification:
+ * Previously the content was wrapped with a `span`, now wrapped with a `div`
+ * Content wrapping div now as the class name of `tablesorter-header-inner` applied to it.
+* Various widget fixes:
+ * The `$.tablesorter.storage` code now loads saved variables before updating. Fix for [issue #41](https://github.com/Mottie/tablesorter/issues/41).
+ * Reverted the "filter" widget code to work like it is supposed to. Fix for [issue #40](https://github.com/Mottie/tablesorter/issues/40).
+ * Modified the "stickHeaders" widget to now set the width of the content instead of the table cell. It seems to work better. Fix for [issue #37](https://github.com/Mottie/tablesorter/issues/37)
+ * Fixed the "uitheme" widget code to update the sorting icon correctly.
+
Version 2.1.6 (3/22/2012)
============================
diff --git a/css/blue/blue.zip b/css/blue/blue.zip
index cda62874..a599f5d0 100644
Binary files a/css/blue/blue.zip and b/css/blue/blue.zip differ
diff --git a/css/blue/style.css b/css/blue/style.css
index e54da74e..98a7345d 100644
--- a/css/blue/style.css
+++ b/css/blue/style.css
@@ -8,17 +8,23 @@ table.tablesorter {
text-align: left;
border-spacing: 0;
}
-table.tablesorter, table.tablesorter th, table.tablesorter tr.tablesorter-stickyHeader th, table.tablesorter td {
+table.tablesorter,
+table.tablesorter th,
+table.tablesorter tr.tablesorter-stickyHeader th,
+table.tablesorter td {
border: #cdcdcd 1px solid;
}
-table.tablesorter thead tr th, tr.tablesorter-stickyHeader th, table.tablesorter tfoot tr th {
+table.tablesorter thead tr th,
+tr.tablesorter-stickyHeader th,
+table.tablesorter tfoot tr th {
background-color: #e6eeee;
border-collapse: collapse;
font-size: 12px;
padding: 4px 20px 4px 4px;
}
-table.tablesorter thead tr .header, tr.tablesorter-stickyHeader .header {
+table.tablesorter thead tr .tablesorter-header,
+tr.tablesorter-stickyHeader .tablesorter-header {
background-image: url(black-bg.gif);
background-repeat: no-repeat;
background-position: center right;
@@ -30,11 +36,13 @@ table.tablesorter tbody td {
background-color: #fff;
vertical-align: top;
}
-table.tablesorter thead tr .headerSortUp {
+table.tablesorter thead tr .headerSortUp,
+table.tablesorter thead tr .tablesorter-headerSortUp {
background-color: #8dbdd8;
background-image: url(black-asc.gif);
}
-table.tablesorter thead tr .headerSortDown {
+table.tablesorter thead tr .headerSortDown,
+table.tablesorter thead tr .tablesorter-headerSortDown {
background-color: #8dbdd8;
background-image: url(black-desc.gif);
}
diff --git a/css/green/green.zip b/css/green/green.zip
index e63c8988..578121f1 100644
Binary files a/css/green/green.zip and b/css/green/green.zip differ
diff --git a/css/green/style.css b/css/green/style.css
index e82f383b..5e4cd488 100644
--- a/css/green/style.css
+++ b/css/green/style.css
@@ -8,11 +8,16 @@ table.tablesorter {
text-align: left;
border-spacing: 0;
}
-table.tablesorter, table.tablesorter th, table.tablesorter tr.tablesorter-stickyHeader th, table.tablesorter td {
+table.tablesorter,
+table.tablesorter th,
+table.tablesorter tr.tablesorter-stickyHeader th,
+table.tablesorter td {
border: #cdcdcd 1px solid;
}
-table.tablesorter thead tr th, tr.tablesorter-stickyHeader th, table.tablesorter tfoot tr th {
+table.tablesorter thead tr th,
+tr.tablesorter-stickyHeader th,
+table.tablesorter tfoot tr th {
border-collapse: collapse;
font-size: 12px;
padding: 5px;
@@ -21,24 +26,32 @@ table.tablesorter td {
color: #3d3d3d;
padding: 5px;
}
-table.tablesorter thead tr, table.tablesorter tfoot tr {
+table.tablesorter thead tr.tablesorter-header,
+table.tablesorter thead tr.tablesorter-stickyHeader,
+table.tablesorter tfoot tr {
background: url(bkgd.png) center center repeat-x;
}
-table.tablesorter .header {
+table.tablesorter .header,
+table.tablesorter .tablesorter-header {
background: transparent;
border-right: #cdcdcd 1px solid;
padding: 9px;
height: auto;
cursor: pointer;
}
-table.tablesorter .header span:first-child, .tablesorter-stickyHeader .header span:first-child {
+table.tablesorter .header span:first-child,
+.tablesorter-stickyHeader .header span:first-child,
+table.tablesorter th.tablesorter-header .tablesorter-header-inner,
+.tablesorter-stickyHeader th.tablesorter-header .tablesorter-header-inner {
background: url(none.png) no-repeat;
padding: 2px 0 2px 25px;
}
-table.tablesorter .headerSortUp span:first-child {
+table.tablesorter .headerSortUp span:first-child,
+table.tablesorter .tablesorter-headerSortUp .tablesorter-header-inner {
background: url(asc.png) no-repeat;
}
-table.tablesorter .headerSortDown span:first-child {
+table.tablesorter .headerSortDown span:first-child,
+table.tablesorter .tablesorter-headerSortDown .tablesorter-header-inner {
background: url(desc.png) no-repeat;
}
@@ -51,21 +64,24 @@ table.tablesorter tr.even td {
}
/* Column Widget - column sort colors */
-table.tablesorter tbody td.primary, table.tablesorter tbody tr.odd td.primary {
+table.tablesorter tbody td.primary,
+table.tablesorter tbody tr.odd td.primary {
background-color: #c0ffc0;
}
table.tablesorter tbody tr.even td.primary {
background-color: #e8ffe8;
}
-table.tablesorter tbody td.secondary, table.tablesorter tbody tr.odd td.secondary {
+table.tablesorter tbody td.secondary,
+table.tablesorter tbody tr.odd td.secondary {
background-color: #d6ffd6;
}
table.tablesorter tbody tr.even td.secondary {
background-color: #e8ffe8;
}
-table.tablesorter tbody td.tertiary, table.tablesorter tbody tr.odd td.tertiary {
+table.tablesorter tbody td.tertiary,
+table.tablesorter tbody tr.odd td.tertiary {
background-color: #eaffea;
}
table.tablesorter tbody tr.even td.tertiary {
@@ -79,7 +95,8 @@ table.tablesorter thead tr.tablesorter-filter input.tablesorter-filter {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
-table.tablesorter thead tr.tablesorter-filter, table.tablesorter thead tr.tablesorter-filter td {
+table.tablesorter thead tr.tablesorter-filter,
+table.tablesorter thead tr.tablesorter-filter td {
text-align: center;
background: #fff;
}
diff --git a/css/ui/style.css b/css/ui/style.css
index 1f8db571..a4555749 100644
--- a/css/ui/style.css
+++ b/css/ui/style.css
@@ -7,7 +7,8 @@ table.tablesorter {
text-align: left;
padding: 5px;
}
-table.tablesorter thead tr th, table.tablesorter tfoot tr th {
+table.tablesorter thead tr th,
+table.tablesorter tfoot tr th {
border-collapse: collapse;
font-size: 8pt;
padding: 4px;
@@ -47,7 +48,8 @@ table.tablesorter thead tr.tablesorter-filter input.tablesorter-filter {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
-table.tablesorter thead tr.tablesorter-filter, table.tablesorter thead tr.tablesorter-filter td {
+table.tablesorter thead tr.tablesorter-filter,
+table.tablesorter thead tr.tablesorter-filter td {
text-align: center;
}
/* optional disabled input styling */
diff --git a/docs/example-option-render-header.html b/docs/example-option-render-header.html
index 6134ef27..87242f73 100644
--- a/docs/example-option-render-header.html
+++ b/docs/example-option-render-header.html
@@ -27,7 +27,7 @@
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
}
-.headerSortDown .roundedCorners {
+.tablesorter-headerSortDown .roundedCorners {
border-color: #fff;
}
diff --git a/docs/index.html b/docs/index.html
index 686aaad7..7ca46fe1 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -403,12 +403,12 @@
parsers |
Object |
- {} |
+ { } |
Internal list of all of the parsers. Here is a complete list of default parsers:
@@ -865,7 +865,7 @@ $(function(){
widgets |
Array |
- [] (empty array) |
+ [ ] (empty array) |
Initialize widgets using this option ( e.g. widgets : ['zebra'] , or custom widgets widgets: ['zebra', 'myCustomWidget']; , see this demo on how to write your own custom widget ).
|
@@ -886,7 +886,7 @@ $(function(){
widgetOptions |
Object |
- {} |
+ { } |
As of version 2.1, all widget options have been moved into this option. This is a move to store all widget specific options in one place so as not to polute the main table options. All current widgets have been modified to use this new option. New! in v2.1.
@@ -1485,7 +1485,7 @@ $(table)
Optional / Add-Ons:
- - jQuery Metadata 2.1 (3,7kb, required for setting inline options)
+ - jQuery Metadata 2.1 (6kb, required for setting inline options)
- jquery.tablesorter.js (30kb/17kb min)
- jquery.tablesorter.pager.js (14kb/7kb min, demo)
- jquery.tablesorter.widgets.js (15kb/7kb min, includes the jQuery UI theme, columns styling, resizable columns, filter, sticky header and save sort widgets. Updated! in v2.1.)
diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js
index 3354c456..1da0cb27 100644
--- a/js/jquery.tablesorter.js
+++ b/js/jquery.tablesorter.js
@@ -1,5 +1,5 @@
/*!
-* TableSorter 2.1.6 - Client-side table sorting with ease!
+* TableSorter 2.1.7 - Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
* Copyright (c) 2007 Christian Bach
@@ -18,13 +18,13 @@
$.extend({
tablesorter: new function(){
- this.version = "2.1.6";
+ this.version = "2.1.7";
var parsers = [], widgets = [], tbl;
this.defaults = {
- cssHeader: "header",
- cssAsc: "headerSortUp",
- cssDesc: "headerSortDown",
+ cssHeader: "tablesorter-header",
+ cssAsc: "tablesorter-headerSortUp",
+ cssDesc: "tablesorter-headerSortDown",
cssChildRow: "expand-child",
sortInitialOrder: "asc",
sortMultiSortKey: "shiftKey",
@@ -347,12 +347,12 @@
time = new Date();
}
$tableHeaders = $(c.selectorHeaders, table)
- .wrapInner("")
+ .wrapInner("")
.each(function (index) {
this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
this.order = formatSortingOrder( checkHeaderOrder(table, index) ) ? [1,0,2] : [0,1,2];
this.count = -1; // set to -1 because clicking on the header automatically adds one
- if (checkHeaderMetadata(this) || checkHeaderOptions(table, index) || $(this).is('.sorter-false')) { this.sortDisabled = true; }
+ if (checkHeaderMetadata(this) || checkHeaderOptions(table, index) || $(this).hasClass('sorter-false')) { this.sortDisabled = true; }
this.lockedOrder = false;
lock = checkHeaderLocked(table, index);
if (typeof(lock) !== 'undefined' && lock !== false) {
@@ -364,7 +364,7 @@
}
// add cell to headerList
c.headerList[index] = this;
- $(this).parent().addClass('tablesorter-header');
+ $(this).parent().addClass(c.cssHeader);
});
if (c.debug) {
benchmark("Built headers", time);
diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js
index 6d031709..3e573ca3 100644
--- a/js/jquery.tablesorter.min.js
+++ b/js/jquery.tablesorter.min.js
@@ -1,6 +1,6 @@
/*!
-* TableSorter 2.1.6 - Client-side table sorting with ease!
+* TableSorter 2.1.7 - Client-side table sorting with ease!
* Minified using http://dean.edwards.name/packer/
* Copyright (c) 2007 Christian Bach
*/
-!(function($){$.extend({tablesorter:new function(){this.version="2.1.6";var g=[],widgets=[],tbl;this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:false,sortReset:false,sortRestart:false,textExtraction:"simple",parsers:{},widgets:[],headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"mmddyyyy",usNumberFormat:true,onRenderHeader:null,selectorHeaders:'thead th',selectorRemove:"tr.remove-me",tableClass:'tablesorter',debug:false,widgetOptions:{zebra:["even","odd"]}};function log(s){if(typeof console!=="undefined"&&typeof console.log!=="undefined"){console.log(s)}else{alert(s)}}function benchmark(s,d){log(s+" ("+(new Date().getTime()-d.getTime())+"ms)")}this.benchmark=benchmark;this.hasInitialized=false;function getElementText(a,b,c){var d="",te=a.textExtraction;if(!b){return""}if(!a.supportsTextContent){a.supportsTextContent=b.textContent||false}if(te==="simple"){if(a.supportsTextContent){d=b.textContent}else{if(b.childNodes[0]&&b.childNodes[0].hasChildNodes()){d=b.childNodes[0].innerHTML}else{d=b.innerHTML}}}else{if(typeof(te)==="function"){d=te(b,tbl,c)}else if(typeof(te)==="object"&&te.hasOwnProperty(c)){d=te[c](b,tbl,c)}else{d=$(b).text()}}return d}function getParserById(a){var i,l=g.length;for(i=0;i").each(function(a){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(checkHeaderOrder(b,a))?[1,0,2]:[0,1,2];this.count=-1;if(checkHeaderMetadata(this)||checkHeaderOptions(b,a)||$(this).is('.sorter-false')){this.sortDisabled=true}this.lockedOrder=false;lock=checkHeaderLocked(b,a);if(typeof(lock)!=='undefined'&&lock!==false){this.order=this.lockedOrder=formatSortingOrder(lock)?[1,1,1]:[0,0,0]}if(!this.sortDisabled){$th=$(this).addClass(c.cssHeader);if(c.onRenderHeader){c.onRenderHeader.apply($th,[a])}}c.headerList[a]=this;$(this).parent().addClass('tablesorter-header')});if(c.debug){benchmark("Built headers",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(a,b,d){var i,cell,arr=[],r=a.tHead.rows,c=r[d].cells;for(i=0;i1){arr=arr.concat(checkCellColSpan(a,b,d++))}else{if(a.tHead.length===1||(cell.rowSpan>1||!r[d+1])){arr.push(cell)}}}return arr}function isValueInArray(v,a){var i,l=a.length;for(i=0;i');$("tr:first td",a.tBodies[0]).each(function(){c.append($('').css('width',$(this).width()))});$(a).prepend(c)}}function updateHeaderSortCount(a,b){var i,s,o,c=a.config,l=b.length;for(i=0;ib)?1:-1}catch(er){return 0}}function sortTextDesc(a,b){if(a===''){return 1}if(b===''){return-1}if(a===b){return 0}if($.data(tbl[0],"tablesorter").sortLocaleCompare){return b.localeCompare(a)}return-sortText(a,b)}function getTextValue(a,b,d){if(b){var i,l=a.length,n=b+d;for(i=0;i0){d.trigger("sorton",[c.sortList])}else{applyWidget(this)}this.hasInitialized=true})};this.addParser=function(b){var i,l=g.length,a=true;for(i=0;i").each(function(a){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(checkHeaderOrder(b,a))?[1,0,2]:[0,1,2];this.count=-1;if(checkHeaderMetadata(this)||checkHeaderOptions(b,a)||$(this).hasClass('sorter-false')){this.sortDisabled=true}this.lockedOrder=false;lock=checkHeaderLocked(b,a);if(typeof(lock)!=='undefined'&&lock!==false){this.order=this.lockedOrder=formatSortingOrder(lock)?[1,1,1]:[0,0,0]}if(!this.sortDisabled){$th=$(this).addClass(c.cssHeader);if(c.onRenderHeader){c.onRenderHeader.apply($th,[a])}}c.headerList[a]=this;$(this).parent().addClass(c.cssHeader)});if(c.debug){benchmark("Built headers",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(a,b,d){var i,cell,arr=[],r=a.tHead.rows,c=r[d].cells;for(i=0;i1){arr=arr.concat(checkCellColSpan(a,b,d++))}else{if(a.tHead.length===1||(cell.rowSpan>1||!r[d+1])){arr.push(cell)}}}return arr}function isValueInArray(v,a){var i,l=a.length;for(i=0;i');$("tr:first td",a.tBodies[0]).each(function(){c.append($('').css('width',$(this).width()))});$(a).prepend(c)}}function updateHeaderSortCount(a,b){var i,s,o,c=a.config,l=b.length;for(i=0;ib)?1:-1}catch(er){return 0}}function sortTextDesc(a,b){if(a===''){return 1}if(b===''){return-1}if(a===b){return 0}if($.data(tbl[0],"tablesorter").sortLocaleCompare){return b.localeCompare(a)}return-sortText(a,b)}function getTextValue(a,b,d){if(b){var i,l=a.length,n=b+d;for(i=0;i0){d.trigger("sorton",[c.sortList])}else{applyWidget(this)}this.hasInitialized=true})};this.addParser=function(b){var i,l=g.length,a=true;for(i=0;i table ID/index on page > data
v[url] = {};
v[url][id] = {};
v[url][id] = val;
+ v = $.extend( o, v );
// *** set val ***
if (ls) {
localStorage[key] = JSON.stringify(v);
@@ -44,17 +58,9 @@ $.tablesorter.storage = function(table, key, val){
d.setTime(d.getTime()+(31536e+6)); // 365 days
document.cookie = key + '=' + (JSON.stringify(v)).replace(/\"/g,'\"') + '; expires=' + d.toGMTString() + '; path=/';
}
- } else if ($.parseJSON) {
- // *** get val ***
- if (ls) {
- v = $.parseJSON(localStorage[key]) || {};
- } else {
- k = document.cookie.split(/[;\s|=]/); // cookie
- d = $.inArray(key, k) + 1; // add one to get from the key to the value
- v = (d !== 0) ? $.parseJSON(k[d]) || {} : {};
- }
+ } else {
+ return ( o && o.hasOwnProperty(url) && o[url].hasOwnProperty(id) ) ? o[url][id] : {};
}
- return ( v && v.hasOwnProperty(url) && v[url].hasOwnProperty(id)) ? v[url][id] : {};
};
// Widget: jQuery UI theme
@@ -96,7 +102,7 @@ $.tablesorter.addWidget({
$t.find('span.ui-icon').removeClass(rmv + ' ui-icon');
} else {
klass = ($t.hasClass(c.cssAsc)) ? icons[1] : ($t.hasClass(c.cssDesc)) ? icons[2] : $t.hasClass(c.cssHeader) ? icons[0] : '';
- t = ($table.hasClass('hasStickyHeaders')) ? $table.find('tr.' + wo.stickyHeaders || 'tablesorter-stickyheader').find('th').eq(i).add($t) : $t;
+ t = ($table.hasClass('hasStickyHeaders')) ? $table.find('tr.' + (wo.stickyHeaders || 'tablesorter-stickyHeader')).find('th').eq(i).add($t) : $t;
t[klass === icons[0] ? 'removeClass' : 'addClass']('ui-state-active')
.find('span.ui-icon').removeClass(rmv).addClass(klass);
}
@@ -190,7 +196,7 @@ $.tablesorter.addWidget({
typeof wo.filter_childRows !== 'undefined' ? wo.filter_childRows : true)) ? cr.text() : '';
$td = $(this).find('td');
for (i=0; i < cols; i++){
- x = $.inArray( v[i], ($td.eq(i).text() + t).toLowerCase() );
+ x = ($td.eq(i).text() + t).toLowerCase().indexOf(v[i]);
if (v[i] !== '' && ( (!wo.filter_startsWith && x >= 0) || (wo.filter_startsWith && x === 0) ) ) {
r = (r) ? true : false;
} else if (v[i] !== '') {
@@ -223,14 +229,13 @@ $.tablesorter.addWidget({
win = $(window),
header = $(table).find('thead'),
hdrCells = header.find('tr').children(),
- css = wo.stickyHeaders || 'tablesorter-stickyheader',
+ css = wo.stickyHeaders || 'tablesorter-stickyHeader',
firstCell = hdrCells.eq(0),
- brdr = parseInt(firstCell.css('border-left-width'),10),
sticky = header.find('tr.tablesorter-header').clone()
.removeClass('tablesorter-header')
.addClass(css)
.css({
- width : header.outerWidth() + brdr,
+ width : header.outerWidth(true),
position : 'fixed',
left : firstCell.offset().left,
margin : 0,
@@ -239,7 +244,7 @@ $.tablesorter.addWidget({
zIndex : 10
}),
stkyCells = sticky.children(),
- laststate;
+ laststate = '';
// update sticky header class names to match real header after sorting
$table.bind('sortEnd', function(e,t){
var th = $(t).find('thead tr'),
@@ -254,8 +259,6 @@ $.tablesorter.addWidget({
hdrCells.each(function(i){
var t = $(this),
s = stkyCells.eq(i)
- // set cell widths
- .width( t.width() + brdr )
// clicking on sticky will trigger sort
.bind('click', function(e){
t.trigger(e);
@@ -264,7 +267,9 @@ $.tablesorter.addWidget({
.bind('mousedown', function(){
this.onselectstart = function(){ return false; };
return false;
- });
+ })
+ // set cell widths
+ .find('.tablesorter-header-inner').width( t.find('.tablesorter-header-inner').width() );
});
header.prepend( sticky );
// make it sticky!
@@ -286,10 +291,10 @@ $.tablesorter.addWidget({
.resize(function(){
sticky.css({
left : firstCell.offset().left - win.scrollLeft(),
- width: header.outerWidth() + brdr
+ width: header.outerWidth()
});
- stkyCells.each(function(i){
- $(this).width( hdrCells.eq(i).width() + brdr );
+ stkyCells.find('.tablesorter-header-inner').each(function(i){
+ $(this).width( hdrCells.eq(i).find('.tablesorter-header-inner').width() );
});
});
}
diff --git a/js/jquery.tablesorter.widgets.min.js b/js/jquery.tablesorter.widgets.min.js
index 4bd0cc1d..619f3b9c 100644
--- a/js/jquery.tablesorter.widgets.min.js
+++ b/js/jquery.tablesorter.widgets.min.js
@@ -1,10 +1,10 @@
-/*! tableSorter 2.1 widgets - updated 3/22/2012 */
+/*! tableSorter 2.1 widgets - updated 3/26/2012 */
(function(b){
-b.tablesorter.storage=function(a,e,c){var d,f=!1;d={};var a=a.id||b(".tablesorter").index(b(a)),g=window.location.pathname;try{f=!!localStorage.getItem}catch(j){}c&&JSON&&JSON.hasOwnProperty("stringify")?(d[g]={},d[g][a]={},d[g][a]=c,f?localStorage[e]=JSON.stringify(d):(c=new Date,c.setTime(c.getTime()+31536E6),document.cookie=e+"="+JSON.stringify(d).replace(/\"/g,'"')+"; expires="+c.toGMTString()+"; path=/")):b.parseJSON&&(f?d=b.parseJSON(localStorage[e])||{}:(d=document.cookie.split(/[;\s|=]/), c=b.inArray(e,d)+1,d=0!==c?b.parseJSON(d[c])||{}:{}));return d&&d.hasOwnProperty(g)&&d[g].hasOwnProperty(a)?d[g][a]:{}};
-b.tablesorter.addWidget({id:"uitheme",format:function(a){var e,c,d,f,g,j=b(a),i=a.config,h=i.widgetOptions,k=["ui-icon-arrowthick-2-n-s","ui-icon-arrowthick-1-s","ui-icon-arrowthick-1-n"],k=i.widgetUitheme&&i.widgetUitheme.hasOwnProperty("css")?i.widgetUitheme.css||k:h&&h.hasOwnProperty("uitheme")?h.uitheme:k;d=k.join(" ");i.debug&&(e=new Date);j.hasClass("ui-theme")||(j.addClass("ui-widget ui-widget-content ui-corner-all ui-theme"), b.each(i.headerList,function(){b(this).addClass("ui-widget-header ui-corner-all ui-state-default").append('').wrapInner('').hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")})}));b.each(i.headerList,function(a){f=b(this);if(this.sortDisabled)f.find("span.ui-icon").removeClass(d+" ui-icon");else{c=f.hasClass(i.cssAsc)?k[1]:f.hasClass(i.cssDesc)?k[2]:f.hasClass(i.cssHeader)?k[0]:"";g=j.hasClass("hasStickyHeaders")? j.find("tr."+h.stickyHeaders||"tablesorter-stickyheader").find("th").eq(a).add(f):f;g[c===k[0]?"removeClass":"addClass"]("ui-state-active").find("span.ui-icon").removeClass(d).addClass(c)}});i.debug&&b.tablesorter.benchmark("Applying uitheme widget",e)}});
-b.tablesorter.addWidget({id:"columns",format:function(a){var e,c,d,f,g=a.config,j=g.sortList,i=j.length,h=["primary","secondary","tertiary"],h=g.widgetColumns&&g.widgetColumns.hasOwnProperty("css")?g.widgetColumns.css||h:g.widgetOptions&&g.widgetOptions.hasOwnProperty("columns")? g.widgetOptions.columns||h:h;d=h.length-1;f=h.join(" ");g.debug&&(c=new Date);j&&j[0]?b("tr:visible",a.tBodies[0]).each(function(a){e=b(this).children().removeClass(f);e.eq(j[0][0]).addClass(h[0]);if(1',o;h.debug&&(o=new Date);for(e=0;e | ";n.find("thead").append(a+=" ").find("input."+l).bind("keyup search",function(){c=n.find("thead").find("input."+l).map(function(){return(b(this).val()|| "").toLowerCase()}).get();""===c.join("")?n.find("tr").show():n.find("tbody").find("tr:not(."+h.cssChildRow+")").each(function(){d=!0;j=b(this).nextUntil("tr:not(."+h.cssChildRow+")");f=j.length&&(k&&k.hasOwnProperty("filter_childRows")&&"undefined"!==typeof k.filter_childRows?k.filter_childRows:1)?j.text():"";i=b(this).find("td");for(e=0;e b.top&&a ').wrapInner('')}).bind("mousemove", function(a){if(0!==g&&j){var b=a.pageX-g;j.width()<-b||i&&i.width()<=b||(i.width(i.width()+b),g=a.pageX)}}).bind("mouseup",function(){c&&b.tablesorter.storage&&j&&(c[i.index()]=i.width(),b.tablesorter.storage(a,"tablesorter-resizable",c));h();return!1}).find(".tablesorter-resizer").bind("mousedown",function(a){j=b(a.target).closest("th");i=j.prev();g=a.pageX});b(a).find("thead").bind("mouseup mouseleave",function(){h()})}}});
-b.tablesorter.addWidget({id:"saveSort",init:function(a,b,c){c.format(a,!0)}, format:function(a,e){var c,d,f=a.config;c={sortList:f.sortList};f.debug&&(d=new Date);b(a).hasClass("hasSaveSort")?a.hasInitialized&&b.tablesorter.storage&&(b.tablesorter.storage(a,"tablesorter-savesort",c),f.debug&&b.tablesorter.benchmark("saveSort widget: Saving last sort: "+f.sortList,d)):(b(a).addClass("hasSaveSort"),c="",b.tablesorter.storage&&(c=(c=b.tablesorter.storage(a,"tablesorter-savesort"))&&c.hasOwnProperty("sortList")&&b.isArray(c.sortList)?c.sortList:"",f.debug&&b.tablesorter.benchmark("saveSort: Last sort loaded: "+ c,d)),e&&c&&0').wrapInner('').hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")})}));b.each(f.headerList,function(a){i=b(this);if(this.sortDisabled)i.find("span.ui-icon").removeClass(c+" ui-icon");else{d=i.hasClass(f.cssAsc)? k[1]:i.hasClass(f.cssDesc)?k[2]:i.hasClass(f.cssHeader)?k[0]:"";j=g.hasClass("hasStickyHeaders")?g.find("tr."+(h.stickyHeaders||"tablesorter-stickyHeader")).find("th").eq(a).add(i):i;j[d===k[0]?"removeClass":"addClass"]("ui-state-active").find("span.ui-icon").removeClass(c).addClass(d)}});f.debug&&b.tablesorter.benchmark("Applying uitheme widget",e)}});
+b.tablesorter.addWidget({id:"columns",format:function(a){var e,d,c,i,j=a.config,g=j.sortList,f=g.length,h=["primary","secondary","tertiary"],h=j.widgetColumns&& j.widgetColumns.hasOwnProperty("css")?j.widgetColumns.css||h:j.widgetOptions&&j.widgetOptions.hasOwnProperty("columns")?j.widgetOptions.columns||h:h;c=h.length-1;i=h.join(" ");j.debug&&(d=new Date);g&&g[0]?b("tr:visible",a.tBodies[0]).each(function(a){e=b(this).children().removeClass(i);e.eq(g[0][0]).addClass(h[0]);if(1',o;h.debug&&(o=new Date);for(e=0;e | ";m.find("thead").append(a+="
").find("input."+ l).bind("keyup search",function(){d=m.find("thead").find("input."+l).map(function(){return(b(this).val()||"").toLowerCase()}).get();""===d.join("")?m.find("tr").show():m.find("tbody").find("tr:not(."+h.cssChildRow+")").each(function(){c=!0;g=b(this).nextUntil("tr:not(."+h.cssChildRow+")");i=g.length&&(k&&k.hasOwnProperty("filter_childRows")&&"undefined"!==typeof k.filter_childRows?k.filter_childRows:1)?g.text():"";f=b(this).find("td");for(e=0;e