mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Merge branch 'master' into gh-pages
This commit is contained in:
commit
31659c062b
38
README.md
38
README.md
@ -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
|
||||
|
73
dist/js/jquery.tablesorter.combined.js
vendored
73
dist/js/jquery.tablesorter.combined.js
vendored
@ -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');
|
||||
|
||||
},
|
||||
|
4
dist/js/jquery.tablesorter.combined.min.js
vendored
4
dist/js/jquery.tablesorter.combined.min.js
vendored
File diff suppressed because one or more lines are too long
45
dist/js/jquery.tablesorter.js
vendored
45
dist/js/jquery.tablesorter.js
vendored
@ -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
|
||||
|
2
dist/js/jquery.tablesorter.min.js
vendored
2
dist/js/jquery.tablesorter.min.js
vendored
File diff suppressed because one or more lines are too long
28
dist/js/jquery.tablesorter.widgets.js
vendored
28
dist/js/jquery.tablesorter.widgets.js
vendored
@ -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');
|
||||
|
||||
},
|
||||
|
4
dist/js/jquery.tablesorter.widgets.min.js
vendored
4
dist/js/jquery.tablesorter.widgets.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/js/widgets/widget-stickyHeaders.min.js
vendored
4
dist/js/widgets/widget-stickyHeaders.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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">†</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">†</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">†</span> <a href="#function-storage">Storage Widget</a> (<span class="version">v2.20.0</span>; <span class="version updated">v2.28.8</span>).</li>
|
||||
@ -797,6 +797,18 @@
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr id="cssicondisabled">
|
||||
<td><a href="#" class="permalink">cssIconDisabled</a></td>
|
||||
<td>String</td>
|
||||
<td>""</td>
|
||||
<td>The CSS style used to style the header cell icon when the column sort is disabled (<span class="version">v2.28.13</span>)
|
||||
<div class="collapsible"><br>
|
||||
This class is only applied when the <a href="#headertemplate"><code>headerTemplate</code></a> option includes a <code>{icon}</code> tag or an HTML element with the class name from the <a href="#cssicon"><code>cssIcon</code></a> option.
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr id="cssnone">
|
||||
<td><a href="#" class="permalink">cssNone</a></td>
|
||||
<td>String</td>
|
||||
@ -1144,7 +1156,7 @@
|
||||
<div class="collapsible">
|
||||
<br>
|
||||
In versions 2.0.6+, all TH text is wrapped in a div with a class name of "tablesorter-inner" by default. In the example below, the header cell (TH) div is given a class name (<a class="external" href="http://www.pengoworks.com/workshop/jquery/tablesorter/tablesorter.htm">source</a>).<br>
|
||||
Function parameters:
|
||||
<p>Function parameters:</p>
|
||||
<ul>
|
||||
<li><code>index</code> - zero-based index of the current table header cell; this value is <em>not</em> indicative of the column index, as it is simply a count of header cells. So it will be effected by rowspan, colspan and multiple rows in the header.</li>
|
||||
<li><code>config</code> - The current <code>table.config</code>.</li>
|
||||
@ -1177,7 +1189,12 @@
|
||||
This function is called after the template string has been built, but before the template string is applied to the header and before the <code>onRenderHeader</code> function is called (v2.7).
|
||||
<div class="collapsible">
|
||||
<br>
|
||||
The <code>onRenderTemplate</code> function receives a column index and template string parameters. The template string, from the <a href="#headertemplate"><code>headerTemplate</code> option</a>, will already have the <code>{icon}</code> and <code>{content}</code> tags replaced; it's just a string of formatted HTML. When done manipulating this string, return it. Here is an example:
|
||||
The <code>onRenderTemplate</code> function receives a column index and template string parameters. The template string, from the <a href="#headertemplate"><code>headerTemplate</code> option</a>, will already have the <code>{icon}</code> and <code>{content}</code> tags replaced; it's just a string of formatted HTML. When done manipulating this string, return it.
|
||||
<p>Function parameters:</p>
|
||||
<ul>
|
||||
<li><code>index</code> - zero-based index of the current table header cell; this value is <em>not</em> indicative of the column index, as it is simply a count of header cells. So it will be effected by rowspan, colspan and multiple rows in the header.</li>
|
||||
<li><code>template</code> - A rendered <code>headerTemplate</code> HTML string.</li>
|
||||
</ul>
|
||||
<pre class="prettyprint lang-js">$(function(){
|
||||
$("table").tablesorter({
|
||||
headerTemplate: '{icon}{content}',
|
||||
@ -2073,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: '',
|
||||
@ -7276,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 & b parameter using a natural sort (v2.12).
|
||||
<td>This function sorts the a & 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>
|
||||
@ -7288,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>
|
||||
|
@ -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');
|
||||
|
||||
},
|
||||
|
@ -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 : [],
|
||||
@ -98,6 +98,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',
|
||||
@ -1074,7 +1075,7 @@
|
||||
▀████▀ ██ █████▀ ██ ██ ██ ██████
|
||||
*/
|
||||
setHeadersCss : function( c ) {
|
||||
var $sorted, indx, column,
|
||||
var indx, column,
|
||||
list = c.sortList,
|
||||
len = list.length,
|
||||
none = ts.css.sortNone + ' ' + c.cssNone,
|
||||
@ -1082,20 +1083,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 ) {
|
||||
@ -1132,8 +1145,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 ] ] );
|
||||
@ -1806,10 +1819,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
|
||||
|
@ -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');
|
||||
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*! 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
|
||||
*/
|
||||
@ -55,6 +55,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
|
||||
@ -91,8 +98,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() : [],
|
||||
@ -114,7 +120,6 @@
|
||||
$stickyThead = $stickyTable.children('thead:first'),
|
||||
$stickyCells,
|
||||
laststate = '',
|
||||
spacing = 0,
|
||||
setWidth = function($orig, $clone){
|
||||
var index, width, border, $cell, $this,
|
||||
$cells = $orig.filter(':visible'),
|
||||
@ -146,11 +151,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 );
|
||||
@ -161,6 +164,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 ?
|
||||
@ -176,11 +180,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 )
|
||||
@ -280,6 +282,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
// make sure sticky is visible if page is partially scrolled
|
||||
scrollSticky( true );
|
||||
$table.triggerHandler('stickyHeadersInit');
|
||||
|
||||
},
|
||||
|
2077
package-lock.json
generated
Normal file
2077
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||
@ -20,7 +20,7 @@
|
||||
"docs": "https://mottie.github.io/tablesorter/docs/index.html",
|
||||
"demo": "https://github.com/Mottie/tablesorter/wiki",
|
||||
"dependencies": {
|
||||
"jquery": ">=3.2.1"
|
||||
"jquery": ">=1.2.6"
|
||||
},
|
||||
"keywords": [
|
||||
"table",
|
||||
|
@ -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",
|
||||
|
@ -112,7 +112,8 @@ Core plugin tested
|
||||
OPTIONS:
|
||||
cssAsc, cssChildRow, cssDesc, cssHeader, cssHeaderRow, cssInfoBlock, dateFormat, emptyTo, headerList,
|
||||
headers, ignoreCase, initialized, parsers, sortList, sortLocaleCompare, sortReset, sortRestart, stringTo, tableClass,
|
||||
usNumberFormat, widgets (just zebra), sortAppend, sortForce, sortMultiSortKey, sortResetKey, numberSorter
|
||||
usNumberFormat, widgets (just zebra), sortAppend, sortForce, sortMultiSortKey, sortResetKey, numberSorter,
|
||||
cssIconAsc, cssIconDesc, cssIconNone, cssIconDisabled
|
||||
|
||||
METHODS:
|
||||
addRows, applyWidgets, destroy, sorton, sortReset, update/updateRow, updateAll, updateCell
|
||||
@ -123,7 +124,7 @@ EVENTS:
|
||||
Not yet tested
|
||||
=========================
|
||||
OPTIONS:
|
||||
cancelSelection, cssIcon, cssProcessing, debug, delayInit, headerTemplate, initWidgets, onRenderHeader,
|
||||
cancelSelection, cssProcessing, debug, delayInit, headerTemplate, initWidgets, onRenderHeader,
|
||||
onRenderTemplate, selectorHeaders, selectorRemove, selectorSort, serverSideSorting, showProcessing,
|
||||
sortInitialOrder, strings,
|
||||
textExtraction, textSorter, theme, widthFixed, widgets (also need priority testing)
|
||||
@ -694,9 +695,6 @@ jQuery(function($){
|
||||
'a', 'b', 'c1', 'c2'
|
||||
];
|
||||
assert.cacheCompare( $('#testblock table')[0], 'all', t, 'colspans not duplicated but textExtraction defined' );
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
QUnit.test( 'sorton methods', function(assert) {
|
||||
@ -917,6 +915,37 @@ jQuery(function($){
|
||||
assert.equal( t.hasClass(ts.css.sortAsc) || t.hasClass(ts.css.sortDesc), false, 'Testing sortReset' );
|
||||
});
|
||||
|
||||
QUnit.test( 'testing header css icons', function(assert) {
|
||||
var done = assert.async();
|
||||
assert.expect(1);
|
||||
$('#testblock2').html('<table class="tablesorter"><thead><tr>' +
|
||||
'<th>A</th>' +
|
||||
'<th>B</th>' +
|
||||
'<th>C</th>' +
|
||||
'<th class="sorter-false">D</th>' +
|
||||
'</tr></thead><tbody></tbody></table>')
|
||||
.find('table')
|
||||
.tablesorter({
|
||||
sortList: [[0,0], [1,1]],
|
||||
headerTemplate:'{content} {icon}',
|
||||
cssIconAsc: 'asc',
|
||||
cssIconDesc: 'desc',
|
||||
cssIconNone: 'none',
|
||||
cssIconDisabled: 'disabled',
|
||||
initialized: function(table){
|
||||
var i,
|
||||
results = [],
|
||||
expected = ['asc', 'desc', 'none', 'disabled'],
|
||||
c = table.config;
|
||||
for (i = 0; i < c.columns; i++){
|
||||
results[i] = c.$headers.eq(i).find('.' + ts.css.icon).hasClass(expected[i]);
|
||||
}
|
||||
assert.deepEqual( results, [true, true, true, true], 'applies correct cssIcon classes' );
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/************************************************
|
||||
test apply widgets function using zebra widget
|
||||
************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user