This commit is contained in:
Rob Garrison 2017-06-02 17:49:41 -05:00
parent 02c16c4cf9
commit 8dbd34ece6
15 changed files with 180 additions and 138 deletions

View File

@ -104,6 +104,18 @@ If you would like to contribute, please...
View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes).
#### <a name="v2.28.13">Version 2.28.13</a> (6/2/2017)
* Core:
* Add cssIconDisabled option. See [issue #1409](https://github.com/Mottie/tablesorter/issues/1409).
* Coerce sort natural elements into strings. See [issue #1415](https://github.com/Mottie/tablesorter/issues/1415).
* StickyHeaders:
* Fix dynamic updating of offset. Fixes [issue #1412](https://github.com/Mottie/tablesorter/issues/1412).
* Init with visible headers on partial scroll
* Meta:
* Set jQuery dependency back to >=1.2.6. Fixes [issue #1411](https://github.com/Mottie/tablesorter/issues/1411).
* Add `package-lock.json` file.
#### <a name="v2.28.12">Version 2.28.12</a> (5/26/2017)
* ColumnSelector:
@ -136,29 +148,3 @@ View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/C
* Update links to sugarjs/datejs demos.
* Meta:
* Update dependencies.
#### <a name="v2.28.10">Version 2.28.10</a> (5/16/2017)
* Core:
* Disable `updateCell` method for child rows (temporary block until code is fixed).
* Add namespace class name to table.
* Parsers
* Input-select:
* Prevent input select parser from handling events from child rows. See [pull #1399](https://github.com/Mottie/tablesorter/pull/1399); thanks [@andysleigh](https://github.com/andysleigh)!
* Remove unused variables & add `ignoreChildRow` option.
* Bind & update stickyHeaders checkbox. Fixes [issue #261](https://github.com/Mottie/tablesorter/issues/261).
* Meta:
* Use correct `composer.json` jQuery version. Fixes [issue #1398](https://github.com/Mottie/tablesorter/issues/1398).
* Clarify use of GPLv2 license. See [issue #1400](https://github.com/Mottie/tablesorter/issues/1400).
* Update dependencies.
#### <a name="v2.28.9">Version 2.28.9</a> (5/3/2017)
* Core:
* Fix widget option changes across multiple tables; seen in the second table of the math page demo with the `math_ignore` option.
* Docs:
* Add page header section to Math docs. See #1392.
* Fix misspelling.
* update jQuery.
* Math:
* Include noop `math_complete` in defaults; prevents option not recognized warning

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 05-26-2017 (v2.28.12)*/
/*! tablesorter (FORK) - updated 06-02-2017 (v2.28.13)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -10,7 +10,7 @@
}
}(function(jQuery) {
/*! TableSorter (FORK) v2.28.12 *//*
/*! TableSorter (FORK) v2.28.13 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -34,7 +34,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.28.12',
version : '2.28.13',
parsers : [],
widgets : [],
@ -110,6 +110,7 @@
cssIconNone : '', // class name added to the icon when there is no column sort
cssIconAsc : '', // class name added to the icon when the column has an ascending sort
cssIconDesc : '', // class name added to the icon when the column has a descending sort
cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
// *** events
pointerClick : 'click',
@ -1086,7 +1087,7 @@
*/
setHeadersCss : function( c ) {
var $sorted, indx, column,
var indx, column,
list = c.sortList,
len = list.length,
none = ts.css.sortNone + ' ' + c.cssNone,
@ -1094,20 +1095,32 @@
cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
aria = [ 'ascending', 'descending' ],
// find the footer
$headers = c.$table
$extras = c.$table
.find( 'tfoot tr' )
.children( 'td, th' )
.add( $( c.namespace + '_extra_headers' ) )
.removeClass( css.join( ' ' ) );
// remove all header information
c.$headers
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
.removeClass( css.join( ' ' ) )
.addClass( none )
.attr( 'aria-sort', 'none' )
.removeClass( css.join( ' ' ) ),
// remove all header information
$sorted = c.$headers
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
.removeClass( css.join( ' ' ) )
.addClass( none )
.attr( 'aria-sort', 'none' )
.find( '.' + ts.css.icon )
.removeClass( cssIcon.join( ' ' ) )
.end();
// add css none to all sortable headers
$sorted
.not( '.sorter-false' )
.find( '.' + ts.css.icon )
.removeClass( cssIcon.join( ' ' ) )
.addClass( cssIcon[ 2 ] );
// add disabled css icon class
if ( c.cssIconDisabled ) {
$sorted
.filter( '.sorter-false' )
.find( '.' + ts.css.icon )
.addClass( c.cssIconDisabled );
}
for ( indx = 0; indx < len; indx++ ) {
// direction = 2 means reset!
if ( list[ indx ][ 1 ] !== 2 ) {
@ -1144,8 +1157,8 @@
}
}
// add sorted class to footer & extra headers, if they exist
if ( $headers.length ) {
$headers
if ( $extras.length ) {
$extras
.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' )
.removeClass( none )
.addClass( css[ list[ indx ][ 1 ] ] );
@ -1818,10 +1831,10 @@
},
// Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
// this function will only accept strings, or you'll see 'TypeError: undefined is not a function'
// I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall
sortNatural : function( a, b ) {
if ( a === b ) { return 0; }
a = a.toString();
b = b.toString();
var aNum, bNum, aFloat, bFloat, indx, max,
regex = ts.regex;
// first try and sort Hex codes
@ -5146,7 +5159,7 @@
})( jQuery );
/*! Widget: stickyHeaders - updated 1/6/2017 (v2.28.4) *//*
/*! Widget: stickyHeaders - updated 6/2/2017 (v2.28.13) *//*
* Requires tablesorter v2.8+ and jQuery 1.4.3+
* by Rob Garrison
*/
@ -5203,6 +5216,13 @@
}, options.timer);
};
function getStickyOffset(c, wo) {
var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
return $el.length ?
$el.height() || 0 :
parseInt(wo.stickyHeaders_offset, 10) || 0;
}
// Sticky headers based on this awesome article:
// http://css-tricks.com/13465-persistent-headers/
// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
@ -5239,8 +5259,7 @@
$thead = $table.children('thead:first'),
$header = $thead.children('tr').not('.sticky-false').children(),
$tfoot = $table.children('tfoot'),
$stickyOffset = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : '',
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0,
stickyOffset = getStickyOffset(c, wo),
// is this table nested? If so, find parent sticky header wrapper (div, not table)
$nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
$table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
@ -5262,7 +5281,6 @@
$stickyThead = $stickyTable.children('thead:first'),
$stickyCells,
laststate = '',
spacing = 0,
setWidth = function($orig, $clone){
var index, width, border, $cell, $this,
$cells = $orig.filter(':visible'),
@ -5294,11 +5312,9 @@
}
},
resizeHeader = function() {
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0;
spacing = 0;
$stickyWrap.css({
left : $attach.length ? parseInt($attach.css('padding-left'), 10) || 0 :
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing,
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft(),
width: $table.outerWidth()
});
setWidth( $table, $stickyTable );
@ -5309,6 +5325,7 @@
// Detect nested tables - fixes #724
nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
var offset = $table.offset(),
stickyOffset = getStickyOffset(c, wo),
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
xWindow = $.isWindow( $xScroll[0] ),
attachTop = $attach.length ?
@ -5324,11 +5341,9 @@
}
if (xWindow) {
// adjust when scrolling horizontally - fixes issue #143
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing;
}
if ($nestedSticky.length) {
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft();
}
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
$stickyWrap
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
.addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide )
@ -5428,6 +5443,8 @@
});
}
// make sure sticky is visible if page is partially scrolled
scrollSticky( true );
$table.triggerHandler('stickyHeadersInit');
},

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
}
}(function(jQuery) {
/*! TableSorter (FORK) v2.28.12 *//*
/*! TableSorter (FORK) v2.28.13 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -32,7 +32,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.28.12',
version : '2.28.13',
parsers : [],
widgets : [],
@ -108,6 +108,7 @@
cssIconNone : '', // class name added to the icon when there is no column sort
cssIconAsc : '', // class name added to the icon when the column has an ascending sort
cssIconDesc : '', // class name added to the icon when the column has a descending sort
cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
// *** events
pointerClick : 'click',
@ -1084,7 +1085,7 @@
*/
setHeadersCss : function( c ) {
var $sorted, indx, column,
var indx, column,
list = c.sortList,
len = list.length,
none = ts.css.sortNone + ' ' + c.cssNone,
@ -1092,20 +1093,32 @@
cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
aria = [ 'ascending', 'descending' ],
// find the footer
$headers = c.$table
$extras = c.$table
.find( 'tfoot tr' )
.children( 'td, th' )
.add( $( c.namespace + '_extra_headers' ) )
.removeClass( css.join( ' ' ) );
// remove all header information
c.$headers
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
.removeClass( css.join( ' ' ) )
.addClass( none )
.attr( 'aria-sort', 'none' )
.removeClass( css.join( ' ' ) ),
// remove all header information
$sorted = c.$headers
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
.removeClass( css.join( ' ' ) )
.addClass( none )
.attr( 'aria-sort', 'none' )
.find( '.' + ts.css.icon )
.removeClass( cssIcon.join( ' ' ) )
.end();
// add css none to all sortable headers
$sorted
.not( '.sorter-false' )
.find( '.' + ts.css.icon )
.removeClass( cssIcon.join( ' ' ) )
.addClass( cssIcon[ 2 ] );
// add disabled css icon class
if ( c.cssIconDisabled ) {
$sorted
.filter( '.sorter-false' )
.find( '.' + ts.css.icon )
.addClass( c.cssIconDisabled );
}
for ( indx = 0; indx < len; indx++ ) {
// direction = 2 means reset!
if ( list[ indx ][ 1 ] !== 2 ) {
@ -1142,8 +1155,8 @@
}
}
// add sorted class to footer & extra headers, if they exist
if ( $headers.length ) {
$headers
if ( $extras.length ) {
$extras
.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' )
.removeClass( none )
.addClass( css[ list[ indx ][ 1 ] ] );
@ -1816,10 +1829,10 @@
},
// Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
// this function will only accept strings, or you'll see 'TypeError: undefined is not a function'
// I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall
sortNatural : function( a, b ) {
if ( a === b ) { return 0; }
a = a.toString();
b = b.toString();
var aNum, bNum, aFloat, bFloat, indx, max,
regex = ts.regex;
// first try and sort Hex codes

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 05-26-2017 (v2.28.12)*/
/*! tablesorter (FORK) - updated 06-02-2017 (v2.28.13)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -2326,7 +2326,7 @@
})( jQuery );
/*! Widget: stickyHeaders - updated 1/6/2017 (v2.28.4) *//*
/*! Widget: stickyHeaders - updated 6/2/2017 (v2.28.13) *//*
* Requires tablesorter v2.8+ and jQuery 1.4.3+
* by Rob Garrison
*/
@ -2383,6 +2383,13 @@
}, options.timer);
};
function getStickyOffset(c, wo) {
var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
return $el.length ?
$el.height() || 0 :
parseInt(wo.stickyHeaders_offset, 10) || 0;
}
// Sticky headers based on this awesome article:
// http://css-tricks.com/13465-persistent-headers/
// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
@ -2419,8 +2426,7 @@
$thead = $table.children('thead:first'),
$header = $thead.children('tr').not('.sticky-false').children(),
$tfoot = $table.children('tfoot'),
$stickyOffset = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : '',
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0,
stickyOffset = getStickyOffset(c, wo),
// is this table nested? If so, find parent sticky header wrapper (div, not table)
$nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
$table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
@ -2442,7 +2448,6 @@
$stickyThead = $stickyTable.children('thead:first'),
$stickyCells,
laststate = '',
spacing = 0,
setWidth = function($orig, $clone){
var index, width, border, $cell, $this,
$cells = $orig.filter(':visible'),
@ -2474,11 +2479,9 @@
}
},
resizeHeader = function() {
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0;
spacing = 0;
$stickyWrap.css({
left : $attach.length ? parseInt($attach.css('padding-left'), 10) || 0 :
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing,
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft(),
width: $table.outerWidth()
});
setWidth( $table, $stickyTable );
@ -2489,6 +2492,7 @@
// Detect nested tables - fixes #724
nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
var offset = $table.offset(),
stickyOffset = getStickyOffset(c, wo),
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
xWindow = $.isWindow( $xScroll[0] ),
attachTop = $attach.length ?
@ -2504,11 +2508,9 @@
}
if (xWindow) {
// adjust when scrolling horizontally - fixes issue #143
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing;
}
if ($nestedSticky.length) {
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft();
}
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
$stickyWrap
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
.addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide )
@ -2608,6 +2610,8 @@
});
}
// make sure sticky is visible if page is partially scrolled
scrollSticky( true );
$table.triggerHandler('stickyHeadersInit');
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -512,7 +512,7 @@
<li><span class="label label-info">Beta</span> <a href="example-widget-sort-tbodies.html">Sort tbodies widget</a> (<span class="version">v2.22.2</span>; <span class="version updated">v2.28.0</span>).</li>
<li><a href="example-widget-static-row.html">Static row widget</a> (<span class="version">v2.16</span>; <span class="version updated">v2.24.0</span>).</li>
<li><span class="results">&dagger;</span> <a href="example-widget-sticky-header.html">Sticky header widget</a> (v2.0.21.1; <span class="version updated">v2.28.4</span>).</li>
<li><span class="results">&dagger;</span> <a href="example-widget-sticky-header.html">Sticky header widget</a> (v2.0.21.1; <span class="version updated">v2.28.13</span>).</li>
<li><a href="example-widget-css-sticky-header.html">Sticky header (css3) widget</a> (<span class="version">v2.14.2</span>; <span class="version updated">v2.28.11</span>).</li>
<li><span class="results">&dagger;</span> <a href="#function-storage">Storage Widget</a> (<span class="version">v2.20.0</span>; <span class="version updated">v2.28.8</span>).</li>
@ -2090,7 +2090,7 @@ $(function(){
// Any previous saved sort will be restored on page reload.
saveSort: true,
// *** STICKYhEADERS WIDGET ***
// *** STICKYHEADERS WIDGET ***
// stickyHeaders widget: extra class name added to the sticky header
// row
stickyHeaders: '',
@ -7293,7 +7293,7 @@ $.tablesorter.bindEvents( $table, $clonedTable.find('th') );</pre>
<tr id="function-sortnatural">
<td><a href="#" class="permalink">sortNatural</a></td>
<td>This function sorts the a &amp; b parameter using a natural sort (v2.12).
<td>This function sorts the a &amp; b parameter using a natural sort (v2.12; <span class="version updated">v2.28.13</span>).
<div class="collapsible"><br>
Access it as follows:
<pre class="prettyprint lang-js">$.tablesorter.sortNatural(a, b);</pre>
@ -7305,7 +7305,8 @@ $.tablesorter.bindEvents( $table, $clonedTable.find('th') );</pre>
<pre class="prettyprint lang-js">var myArray = [ '1a', '10a', '2a', '2b' ];
// result: ["1a", "2a", "2b", "10a"]
myArray.sort(function(a,b) { return $.tablesorter.sortNatural(a, b); });</pre>
Please note that this natural sort function only accepts strings (added v2.0.6; renamed v2.12).
<del>Please note that this natural sort function only accepts strings (added v2.0.6; renamed v2.12)</del>.<br>
As of <span class="version updated">v2.28.13</span>, the natural sort function will convert all values into strings.
</div>
</td>
</tr>

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 05-26-2017 (v2.28.12)*/
/*! tablesorter (FORK) - updated 06-02-2017 (v2.28.13)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -16,7 +16,7 @@
}
}(function(jQuery) {
/*! TableSorter (FORK) v2.28.12 *//*
/*! TableSorter (FORK) v2.28.13 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -40,7 +40,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.28.12',
version : '2.28.13',
parsers : [],
widgets : [],
@ -116,6 +116,7 @@
cssIconNone : '', // class name added to the icon when there is no column sort
cssIconAsc : '', // class name added to the icon when the column has an ascending sort
cssIconDesc : '', // class name added to the icon when the column has a descending sort
cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
// *** events
pointerClick : 'click',
@ -1092,7 +1093,7 @@
*/
setHeadersCss : function( c ) {
var $sorted, indx, column,
var indx, column,
list = c.sortList,
len = list.length,
none = ts.css.sortNone + ' ' + c.cssNone,
@ -1100,20 +1101,32 @@
cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
aria = [ 'ascending', 'descending' ],
// find the footer
$headers = c.$table
$extras = c.$table
.find( 'tfoot tr' )
.children( 'td, th' )
.add( $( c.namespace + '_extra_headers' ) )
.removeClass( css.join( ' ' ) );
// remove all header information
c.$headers
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
.removeClass( css.join( ' ' ) )
.addClass( none )
.attr( 'aria-sort', 'none' )
.removeClass( css.join( ' ' ) ),
// remove all header information
$sorted = c.$headers
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
.removeClass( css.join( ' ' ) )
.addClass( none )
.attr( 'aria-sort', 'none' )
.find( '.' + ts.css.icon )
.removeClass( cssIcon.join( ' ' ) )
.end();
// add css none to all sortable headers
$sorted
.not( '.sorter-false' )
.find( '.' + ts.css.icon )
.removeClass( cssIcon.join( ' ' ) )
.addClass( cssIcon[ 2 ] );
// add disabled css icon class
if ( c.cssIconDisabled ) {
$sorted
.filter( '.sorter-false' )
.find( '.' + ts.css.icon )
.addClass( c.cssIconDisabled );
}
for ( indx = 0; indx < len; indx++ ) {
// direction = 2 means reset!
if ( list[ indx ][ 1 ] !== 2 ) {
@ -1150,8 +1163,8 @@
}
}
// add sorted class to footer & extra headers, if they exist
if ( $headers.length ) {
$headers
if ( $extras.length ) {
$extras
.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' )
.removeClass( none )
.addClass( css[ list[ indx ][ 1 ] ] );
@ -1824,10 +1837,10 @@
},
// Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
// this function will only accept strings, or you'll see 'TypeError: undefined is not a function'
// I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall
sortNatural : function( a, b ) {
if ( a === b ) { return 0; }
a = a.toString();
b = b.toString();
var aNum, bNum, aFloat, bFloat, indx, max,
regex = ts.regex;
// first try and sort Hex codes
@ -5152,7 +5165,7 @@
})( jQuery );
/*! Widget: stickyHeaders - updated 1/6/2017 (v2.28.4) *//*
/*! Widget: stickyHeaders - updated 6/2/2017 (v2.28.13) *//*
* Requires tablesorter v2.8+ and jQuery 1.4.3+
* by Rob Garrison
*/
@ -5209,6 +5222,13 @@
}, options.timer);
};
function getStickyOffset(c, wo) {
var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
return $el.length ?
$el.height() || 0 :
parseInt(wo.stickyHeaders_offset, 10) || 0;
}
// Sticky headers based on this awesome article:
// http://css-tricks.com/13465-persistent-headers/
// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
@ -5245,8 +5265,7 @@
$thead = $table.children('thead:first'),
$header = $thead.children('tr').not('.sticky-false').children(),
$tfoot = $table.children('tfoot'),
$stickyOffset = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : '',
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0,
stickyOffset = getStickyOffset(c, wo),
// is this table nested? If so, find parent sticky header wrapper (div, not table)
$nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
$table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
@ -5268,7 +5287,6 @@
$stickyThead = $stickyTable.children('thead:first'),
$stickyCells,
laststate = '',
spacing = 0,
setWidth = function($orig, $clone){
var index, width, border, $cell, $this,
$cells = $orig.filter(':visible'),
@ -5300,11 +5318,9 @@
}
},
resizeHeader = function() {
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0;
spacing = 0;
$stickyWrap.css({
left : $attach.length ? parseInt($attach.css('padding-left'), 10) || 0 :
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing,
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft(),
width: $table.outerWidth()
});
setWidth( $table, $stickyTable );
@ -5315,6 +5331,7 @@
// Detect nested tables - fixes #724
nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
var offset = $table.offset(),
stickyOffset = getStickyOffset(c, wo),
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
xWindow = $.isWindow( $xScroll[0] ),
attachTop = $attach.length ?
@ -5330,11 +5347,9 @@
}
if (xWindow) {
// adjust when scrolling horizontally - fixes issue #143
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing;
}
if ($nestedSticky.length) {
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft();
}
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
$stickyWrap
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
.addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide )
@ -5434,6 +5449,8 @@
});
}
// make sure sticky is visible if page is partially scrolled
scrollSticky( true );
$table.triggerHandler('stickyHeadersInit');
},

View File

@ -1,4 +1,4 @@
/*! TableSorter (FORK) v2.28.12 *//*
/*! TableSorter (FORK) v2.28.13 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -22,7 +22,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.28.12',
version : '2.28.13',
parsers : [],
widgets : [],

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 05-26-2017 (v2.28.12)*/
/*! tablesorter (FORK) - updated 06-02-2017 (v2.28.13)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -2332,7 +2332,7 @@
})( jQuery );
/*! Widget: stickyHeaders - updated 1/6/2017 (v2.28.4) *//*
/*! Widget: stickyHeaders - updated 6/2/2017 (v2.28.13) *//*
* Requires tablesorter v2.8+ and jQuery 1.4.3+
* by Rob Garrison
*/
@ -2389,6 +2389,13 @@
}, options.timer);
};
function getStickyOffset(c, wo) {
var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
return $el.length ?
$el.height() || 0 :
parseInt(wo.stickyHeaders_offset, 10) || 0;
}
// Sticky headers based on this awesome article:
// http://css-tricks.com/13465-persistent-headers/
// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
@ -2425,8 +2432,7 @@
$thead = $table.children('thead:first'),
$header = $thead.children('tr').not('.sticky-false').children(),
$tfoot = $table.children('tfoot'),
$stickyOffset = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : '',
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0,
stickyOffset = getStickyOffset(c, wo),
// is this table nested? If so, find parent sticky header wrapper (div, not table)
$nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
$table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
@ -2448,7 +2454,6 @@
$stickyThead = $stickyTable.children('thead:first'),
$stickyCells,
laststate = '',
spacing = 0,
setWidth = function($orig, $clone){
var index, width, border, $cell, $this,
$cells = $orig.filter(':visible'),
@ -2480,11 +2485,9 @@
}
},
resizeHeader = function() {
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0;
spacing = 0;
$stickyWrap.css({
left : $attach.length ? parseInt($attach.css('padding-left'), 10) || 0 :
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing,
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft(),
width: $table.outerWidth()
});
setWidth( $table, $stickyTable );
@ -2495,6 +2498,7 @@
// Detect nested tables - fixes #724
nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
var offset = $table.offset(),
stickyOffset = getStickyOffset(c, wo),
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
xWindow = $.isWindow( $xScroll[0] ),
attachTop = $attach.length ?
@ -2510,11 +2514,9 @@
}
if (xWindow) {
// adjust when scrolling horizontally - fixes issue #143
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing;
}
if ($nestedSticky.length) {
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft();
}
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
$stickyWrap
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
.addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide )
@ -2614,6 +2616,8 @@
});
}
// make sure sticky is visible if page is partially scrolled
scrollSticky( true );
$table.triggerHandler('stickyHeadersInit');
},

View File

@ -1,4 +1,4 @@
/*! Widget: stickyHeaders - updated 6/1/2017 (v2.28.13) *//*
/*! Widget: stickyHeaders - updated 6/2/2017 (v2.28.13) *//*
* Requires tablesorter v2.8+ and jQuery 1.4.3+
* by Rob Garrison
*/

View File

@ -1,7 +1,7 @@
{
"name": "tablesorter",
"title": "tablesorter",
"version": "2.28.12",
"version": "2.28.13",
"description": "tablesorter (FORK) is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.",
"author": {
"name": "Christian Bach",

View File

@ -1,7 +1,7 @@
{
"name": "tablesorter",
"title": "tablesorter",
"version": "2.28.12",
"version": "2.28.13",
"description": "tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.\n\nThis forked version adds lots of new enhancements including: alphanumeric sorting, pager callback functons, multiple widgets providing column styling, ui theme application, sticky headers, column filters and resizer, as well as extended documentation with a lot more demos.",
"author": {
"name": "Christian Bach",