Merge branch 'master' into gh-pages

This commit is contained in:
Rob Garrison 2018-02-25 13:06:31 -06:00
commit 857a9570e6
19 changed files with 153 additions and 106 deletions

View File

@ -104,6 +104,19 @@ If you would like to contribute, please...
View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes). View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes).
#### <a name="v2.29.6">Version 2.29.6</a> (2018-02-25)
* Docs:
* Fix theme selector.
* `pager.page` is zero-based. See [issue #1516](https://github.com/Mottie/tablesorter/issues/1516).
* Resizable:
* Don't save 'auto' table width. Closes [issue #1514](https://github.com/Mottie/tablesorter/issues/1514).
* Scroller:
* Adjust spacing for jQuery UI themes. See [issue #1506](https://github.com/Mottie/tablesorter/issues/1506).
* StickyHeaders:
* Allow nested tables in sticky header. See [Stack Overflow](https://stackoverflow.com/q/48793036/145346).
* Include nested tables inside a scrolling element. Fixes [issue #1512](https://github.com/Mottie/tablesorter/issues/1512).
#### <a name="v2.29.5">Version 2.29.5</a> (2018-01-30) #### <a name="v2.29.5">Version 2.29.5</a> (2018-01-30)
* Docs: * Docs:
@ -115,7 +128,7 @@ View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/C
* Fix linting issue. * Fix linting issue.
* Fix version numbering. * Fix version numbering.
* Parser: * Parser:
* Add radio parser. See [issue #1502(https://github.com/Mottie/tablesorter/issues/1502). * Add radio parser. See [issue #1502](https://github.com/Mottie/tablesorter/issues/1502).
#### <a name="v2.29.4">Version 2.29.4</a> (2018-01-18) #### <a name="v2.29.4">Version 2.29.4</a> (2018-01-18)
@ -127,12 +140,3 @@ View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/C
* Fix select2 issue. Closes [issue #1497](https://github.com/Mottie/tablesorter/issues/1497). * Fix select2 issue. Closes [issue #1497](https://github.com/Mottie/tablesorter/issues/1497).
* Meta: * Meta:
* Change date format in file comments to "YYYY-MM-DD". * Change date format in file comments to "YYYY-MM-DD".
#### <a name="v2.29.3">Version 2.29.3</a> (2018-01-10)
* Docs:
* Update Bootstrap to v4-beta.3.
* Add scroller widget incompatibilities section.
* Add pager size all setting.
* Parser:
* Network parsers now return a text value. Fixes [issue #1494](https://github.com/Mottie/tablesorter/issues/1494).

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 2018-01-30 (v2.29.5)*/ /*! tablesorter (FORK) - updated 2018-02-25 (v2.29.6)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -10,7 +10,7 @@
} }
}(function(jQuery) { }(function(jQuery) {
/*! TableSorter (FORK) v2.29.5 *//* /*! TableSorter (FORK) v2.29.6 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -34,7 +34,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.29.5', version : '2.29.6',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -5327,7 +5327,7 @@
var index, len, $t, var index, len, $t,
$table = c.$table, $table = c.$table,
// add position: relative to attach element, hopefully it won't cause trouble. // add position: relative to attach element, hopefully it won't cause trouble.
$attach = $(wo.stickyHeaders_attachTo), $attach = $(wo.stickyHeaders_attachTo || wo.stickyHeaders_appendTo),
namespace = c.namespace + 'stickyheaders ', namespace = c.namespace + 'stickyheaders ',
// element to watch for the scroll event // element to watch for the scroll event
$yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window), $yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window),
@ -5387,7 +5387,10 @@
}); });
} }
}, },
getLeftPosition = function() { getLeftPosition = function(yWindow) {
if (yWindow === false && $nestedSticky.length) {
return $table.position().left;
}
return $attach.length ? return $attach.length ?
parseInt($attach.css('padding-left'), 10) || 0 : parseInt($attach.css('padding-left'), 10) || 0 :
$table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft(); $table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft();
@ -5408,9 +5411,11 @@
offset = $table.offset(), offset = $table.offset(),
stickyOffset = getStickyOffset(c, wo), stickyOffset = getStickyOffset(c, wo),
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3 yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
attachTop = $attach.length ? yScroll = yWindow ?
( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) : $yScroll.scrollTop() :
$yScroll.scrollTop(), // use parent sticky position if nested AND inside of a scrollable element - see #1512
$nestedSticky.length ? parseInt($nestedSticky[0].style.top, 10) : $yScroll.offset().top,
attachTop = $attach.length ? yScroll : $yScroll.scrollTop(),
captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0, captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0,
scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight, scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight,
tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight, tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight,
@ -5424,12 +5429,14 @@
cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop(); cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
} }
// adjust when scrolling horizontally - fixes issue #143 // adjust when scrolling horizontally - fixes issue #143
tmp = getLeftPosition(); tmp = getLeftPosition(yWindow);
if (tmp !== parseInt($stickyWrap.css('left'), 10)) { if (tmp !== parseInt($stickyWrap.css('left'), 10)) {
needsUpdating = true; needsUpdating = true;
cssSettings.left = tmp; cssSettings.left = tmp;
} }
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop; cssSettings.top = ( cssSettings.top || 0 ) +
// If nested AND inside of a scrollable element, only add parent sticky height
(!yWindow && $nestedSticky.length ? $nestedSticky.height() : stickyOffset + nestedStickyTop);
if (needsUpdating) { if (needsUpdating) {
$stickyWrap $stickyWrap
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide ) .removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
@ -5450,8 +5457,8 @@
if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; } if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
// clear out cloned table, except for sticky header // clear out cloned table, except for sticky header
// include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
$stickyTable.find('thead:gt(0), tr.sticky-false').hide(); $stickyTable.find('> thead:gt(0), tr.sticky-false').hide();
$stickyTable.find('tbody, tfoot').remove(); $stickyTable.find('> tbody, > tfoot').remove();
$stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption); $stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption);
// issue #172 - find td/th in sticky header // issue #172 - find td/th in sticky header
$stickyCells = $stickyThead.children().children(); $stickyCells = $stickyThead.children().children();
@ -5483,7 +5490,6 @@
c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] ); c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] );
} }
} }
// make it sticky! // make it sticky!
$xScroll.add($yScroll) $xScroll.add($yScroll)
.unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') ) .unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') )
@ -5554,7 +5560,7 @@
})(jQuery, window); })(jQuery, window);
/*! Widget: resizable - updated 12/13/2017 (v2.29.1) */ /*! Widget: resizable - updated 2018-02-14 (v2.29.6) */
/*jshint browser:true, jquery:true, unused:false */ /*jshint browser:true, jquery:true, unused:false */
;(function ($, window) { ;(function ($, window) {
'use strict'; 'use strict';
@ -5945,7 +5951,7 @@
if ( vars.overflow && vars.tableWidth ) { if ( vars.overflow && vars.tableWidth ) {
ts.resizable.setWidth( c.$table, vars.tableWidth, true ); ts.resizable.setWidth( c.$table, vars.tableWidth, true );
if ( vars.useStorage ) { if ( vars.useStorage ) {
ts.storage( table, 'tablesorter-table-resized-width', 'auto' ); ts.storage( table, 'tablesorter-table-resized-width', vars.tableWidth );
} }
} }
for ( index = 0; index < c.columns; index++ ) { for ( index = 0; index < c.columns; index++ ) {
@ -5961,7 +5967,7 @@
// reset stickyHeader widths // reset stickyHeader widths
c.$table.triggerHandler( 'stickyHeadersUpdate' ); c.$table.triggerHandler( 'stickyHeadersUpdate' );
if ( ts.storage && !refreshing ) { if ( ts.storage && !refreshing ) {
ts.storage( this, ts.css.resizableStorage, {} ); ts.storage( this, ts.css.resizableStorage, [] );
} }
} }
}); });

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
} }
}(function(jQuery) { }(function(jQuery) {
/*! TableSorter (FORK) v2.29.5 *//* /*! TableSorter (FORK) v2.29.6 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -32,7 +32,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.29.5', version : '2.29.6',
parsers : [], parsers : [],
widgets : [], widgets : [],

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 2018-01-30 (v2.29.5)*/ /*! tablesorter (FORK) - updated 2018-02-25 (v2.29.6)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -2447,7 +2447,7 @@
var index, len, $t, var index, len, $t,
$table = c.$table, $table = c.$table,
// add position: relative to attach element, hopefully it won't cause trouble. // add position: relative to attach element, hopefully it won't cause trouble.
$attach = $(wo.stickyHeaders_attachTo), $attach = $(wo.stickyHeaders_attachTo || wo.stickyHeaders_appendTo),
namespace = c.namespace + 'stickyheaders ', namespace = c.namespace + 'stickyheaders ',
// element to watch for the scroll event // element to watch for the scroll event
$yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window), $yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window),
@ -2507,7 +2507,10 @@
}); });
} }
}, },
getLeftPosition = function() { getLeftPosition = function(yWindow) {
if (yWindow === false && $nestedSticky.length) {
return $table.position().left;
}
return $attach.length ? return $attach.length ?
parseInt($attach.css('padding-left'), 10) || 0 : parseInt($attach.css('padding-left'), 10) || 0 :
$table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft(); $table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft();
@ -2528,9 +2531,11 @@
offset = $table.offset(), offset = $table.offset(),
stickyOffset = getStickyOffset(c, wo), stickyOffset = getStickyOffset(c, wo),
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3 yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
attachTop = $attach.length ? yScroll = yWindow ?
( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) : $yScroll.scrollTop() :
$yScroll.scrollTop(), // use parent sticky position if nested AND inside of a scrollable element - see #1512
$nestedSticky.length ? parseInt($nestedSticky[0].style.top, 10) : $yScroll.offset().top,
attachTop = $attach.length ? yScroll : $yScroll.scrollTop(),
captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0, captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0,
scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight, scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight,
tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight, tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight,
@ -2544,12 +2549,14 @@
cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop(); cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
} }
// adjust when scrolling horizontally - fixes issue #143 // adjust when scrolling horizontally - fixes issue #143
tmp = getLeftPosition(); tmp = getLeftPosition(yWindow);
if (tmp !== parseInt($stickyWrap.css('left'), 10)) { if (tmp !== parseInt($stickyWrap.css('left'), 10)) {
needsUpdating = true; needsUpdating = true;
cssSettings.left = tmp; cssSettings.left = tmp;
} }
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop; cssSettings.top = ( cssSettings.top || 0 ) +
// If nested AND inside of a scrollable element, only add parent sticky height
(!yWindow && $nestedSticky.length ? $nestedSticky.height() : stickyOffset + nestedStickyTop);
if (needsUpdating) { if (needsUpdating) {
$stickyWrap $stickyWrap
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide ) .removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
@ -2570,8 +2577,8 @@
if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; } if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
// clear out cloned table, except for sticky header // clear out cloned table, except for sticky header
// include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
$stickyTable.find('thead:gt(0), tr.sticky-false').hide(); $stickyTable.find('> thead:gt(0), tr.sticky-false').hide();
$stickyTable.find('tbody, tfoot').remove(); $stickyTable.find('> tbody, > tfoot').remove();
$stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption); $stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption);
// issue #172 - find td/th in sticky header // issue #172 - find td/th in sticky header
$stickyCells = $stickyThead.children().children(); $stickyCells = $stickyThead.children().children();
@ -2603,7 +2610,6 @@
c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] ); c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] );
} }
} }
// make it sticky! // make it sticky!
$xScroll.add($yScroll) $xScroll.add($yScroll)
.unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') ) .unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') )
@ -2674,7 +2680,7 @@
})(jQuery, window); })(jQuery, window);
/*! Widget: resizable - updated 12/13/2017 (v2.29.1) */ /*! Widget: resizable - updated 2018-02-14 (v2.29.6) */
/*jshint browser:true, jquery:true, unused:false */ /*jshint browser:true, jquery:true, unused:false */
;(function ($, window) { ;(function ($, window) {
'use strict'; 'use strict';
@ -3065,7 +3071,7 @@
if ( vars.overflow && vars.tableWidth ) { if ( vars.overflow && vars.tableWidth ) {
ts.resizable.setWidth( c.$table, vars.tableWidth, true ); ts.resizable.setWidth( c.$table, vars.tableWidth, true );
if ( vars.useStorage ) { if ( vars.useStorage ) {
ts.storage( table, 'tablesorter-table-resized-width', 'auto' ); ts.storage( table, 'tablesorter-table-resized-width', vars.tableWidth );
} }
} }
for ( index = 0; index < c.columns; index++ ) { for ( index = 0; index < c.columns; index++ ) {
@ -3081,7 +3087,7 @@
// reset stickyHeader widths // reset stickyHeader widths
c.$table.triggerHandler( 'stickyHeadersUpdate' ); c.$table.triggerHandler( 'stickyHeadersUpdate' );
if ( ts.storage && !refreshing ) { if ( ts.storage && !refreshing ) {
ts.storage( this, ts.css.resizableStorage, {} ); ts.storage( this, ts.css.resizableStorage, [] );
} }
} }
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7082,7 +7082,7 @@ $.each( p.cacheIndex, function(i, v) {
<tr id="variable-pager-page"> <tr id="variable-pager-page">
<td><a href="#" class="permalink">p.page</a></td> <td><a href="#" class="permalink">p.page</a></td>
<td>Numeric</td> <td>Numeric</td>
<td>Contains a one-based index of the current page visible in the pager. <td>Contains a zero-based index of the current page visible in the pager.
<div class="collapsible"> <div class="collapsible">
<br> <br>
The <code>{page}</code> tag in the pager <a href="#pager-output"><code>output</code></a> option is replaced by this value.<br> The <code>{page}</code> tag in the pager <a href="#pager-output"><code>output</code></a> option is replaced by this value.<br>

View File

@ -4,7 +4,7 @@
*/ */
/*! tablesorter (FORK) - updated 2018-01-30 (v2.29.5)*/ /*! tablesorter (FORK) - updated 2018-02-25 (v2.29.6)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -16,7 +16,7 @@
} }
}(function(jQuery) { }(function(jQuery) {
/*! TableSorter (FORK) v2.29.5 *//* /*! TableSorter (FORK) v2.29.6 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -40,7 +40,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.29.5', version : '2.29.6',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -5333,7 +5333,7 @@
var index, len, $t, var index, len, $t,
$table = c.$table, $table = c.$table,
// add position: relative to attach element, hopefully it won't cause trouble. // add position: relative to attach element, hopefully it won't cause trouble.
$attach = $(wo.stickyHeaders_attachTo), $attach = $(wo.stickyHeaders_attachTo || wo.stickyHeaders_appendTo),
namespace = c.namespace + 'stickyheaders ', namespace = c.namespace + 'stickyheaders ',
// element to watch for the scroll event // element to watch for the scroll event
$yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window), $yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window),
@ -5393,7 +5393,10 @@
}); });
} }
}, },
getLeftPosition = function() { getLeftPosition = function(yWindow) {
if (yWindow === false && $nestedSticky.length) {
return $table.position().left;
}
return $attach.length ? return $attach.length ?
parseInt($attach.css('padding-left'), 10) || 0 : parseInt($attach.css('padding-left'), 10) || 0 :
$table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft(); $table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft();
@ -5414,9 +5417,11 @@
offset = $table.offset(), offset = $table.offset(),
stickyOffset = getStickyOffset(c, wo), stickyOffset = getStickyOffset(c, wo),
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3 yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
attachTop = $attach.length ? yScroll = yWindow ?
( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) : $yScroll.scrollTop() :
$yScroll.scrollTop(), // use parent sticky position if nested AND inside of a scrollable element - see #1512
$nestedSticky.length ? parseInt($nestedSticky[0].style.top, 10) : $yScroll.offset().top,
attachTop = $attach.length ? yScroll : $yScroll.scrollTop(),
captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0, captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0,
scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight, scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight,
tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight, tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight,
@ -5430,12 +5435,14 @@
cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop(); cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
} }
// adjust when scrolling horizontally - fixes issue #143 // adjust when scrolling horizontally - fixes issue #143
tmp = getLeftPosition(); tmp = getLeftPosition(yWindow);
if (tmp !== parseInt($stickyWrap.css('left'), 10)) { if (tmp !== parseInt($stickyWrap.css('left'), 10)) {
needsUpdating = true; needsUpdating = true;
cssSettings.left = tmp; cssSettings.left = tmp;
} }
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop; cssSettings.top = ( cssSettings.top || 0 ) +
// If nested AND inside of a scrollable element, only add parent sticky height
(!yWindow && $nestedSticky.length ? $nestedSticky.height() : stickyOffset + nestedStickyTop);
if (needsUpdating) { if (needsUpdating) {
$stickyWrap $stickyWrap
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide ) .removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
@ -5456,8 +5463,8 @@
if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; } if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
// clear out cloned table, except for sticky header // clear out cloned table, except for sticky header
// include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
$stickyTable.find('thead:gt(0), tr.sticky-false').hide(); $stickyTable.find('> thead:gt(0), tr.sticky-false').hide();
$stickyTable.find('tbody, tfoot').remove(); $stickyTable.find('> tbody, > tfoot').remove();
$stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption); $stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption);
// issue #172 - find td/th in sticky header // issue #172 - find td/th in sticky header
$stickyCells = $stickyThead.children().children(); $stickyCells = $stickyThead.children().children();
@ -5489,7 +5496,6 @@
c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] ); c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] );
} }
} }
// make it sticky! // make it sticky!
$xScroll.add($yScroll) $xScroll.add($yScroll)
.unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') ) .unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') )
@ -5560,7 +5566,7 @@
})(jQuery, window); })(jQuery, window);
/*! Widget: resizable - updated 12/13/2017 (v2.29.1) */ /*! Widget: resizable - updated 2018-02-14 (v2.29.6) */
/*jshint browser:true, jquery:true, unused:false */ /*jshint browser:true, jquery:true, unused:false */
;(function ($, window) { ;(function ($, window) {
'use strict'; 'use strict';
@ -5951,7 +5957,7 @@
if ( vars.overflow && vars.tableWidth ) { if ( vars.overflow && vars.tableWidth ) {
ts.resizable.setWidth( c.$table, vars.tableWidth, true ); ts.resizable.setWidth( c.$table, vars.tableWidth, true );
if ( vars.useStorage ) { if ( vars.useStorage ) {
ts.storage( table, 'tablesorter-table-resized-width', 'auto' ); ts.storage( table, 'tablesorter-table-resized-width', vars.tableWidth );
} }
} }
for ( index = 0; index < c.columns; index++ ) { for ( index = 0; index < c.columns; index++ ) {
@ -5967,7 +5973,7 @@
// reset stickyHeader widths // reset stickyHeader widths
c.$table.triggerHandler( 'stickyHeadersUpdate' ); c.$table.triggerHandler( 'stickyHeadersUpdate' );
if ( ts.storage && !refreshing ) { if ( ts.storage && !refreshing ) {
ts.storage( this, ts.css.resizableStorage, {} ); ts.storage( this, ts.css.resizableStorage, [] );
} }
} }
}); });

View File

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

View File

@ -4,7 +4,7 @@
*/ */
/*! tablesorter (FORK) - updated 2018-01-30 (v2.29.5)*/ /*! tablesorter (FORK) - updated 2018-02-25 (v2.29.6)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -2453,7 +2453,7 @@
var index, len, $t, var index, len, $t,
$table = c.$table, $table = c.$table,
// add position: relative to attach element, hopefully it won't cause trouble. // add position: relative to attach element, hopefully it won't cause trouble.
$attach = $(wo.stickyHeaders_attachTo), $attach = $(wo.stickyHeaders_attachTo || wo.stickyHeaders_appendTo),
namespace = c.namespace + 'stickyheaders ', namespace = c.namespace + 'stickyheaders ',
// element to watch for the scroll event // element to watch for the scroll event
$yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window), $yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window),
@ -2513,7 +2513,10 @@
}); });
} }
}, },
getLeftPosition = function() { getLeftPosition = function(yWindow) {
if (yWindow === false && $nestedSticky.length) {
return $table.position().left;
}
return $attach.length ? return $attach.length ?
parseInt($attach.css('padding-left'), 10) || 0 : parseInt($attach.css('padding-left'), 10) || 0 :
$table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft(); $table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft();
@ -2534,9 +2537,11 @@
offset = $table.offset(), offset = $table.offset(),
stickyOffset = getStickyOffset(c, wo), stickyOffset = getStickyOffset(c, wo),
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3 yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
attachTop = $attach.length ? yScroll = yWindow ?
( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) : $yScroll.scrollTop() :
$yScroll.scrollTop(), // use parent sticky position if nested AND inside of a scrollable element - see #1512
$nestedSticky.length ? parseInt($nestedSticky[0].style.top, 10) : $yScroll.offset().top,
attachTop = $attach.length ? yScroll : $yScroll.scrollTop(),
captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0, captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0,
scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight, scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight,
tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight, tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight,
@ -2550,12 +2555,14 @@
cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop(); cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
} }
// adjust when scrolling horizontally - fixes issue #143 // adjust when scrolling horizontally - fixes issue #143
tmp = getLeftPosition(); tmp = getLeftPosition(yWindow);
if (tmp !== parseInt($stickyWrap.css('left'), 10)) { if (tmp !== parseInt($stickyWrap.css('left'), 10)) {
needsUpdating = true; needsUpdating = true;
cssSettings.left = tmp; cssSettings.left = tmp;
} }
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop; cssSettings.top = ( cssSettings.top || 0 ) +
// If nested AND inside of a scrollable element, only add parent sticky height
(!yWindow && $nestedSticky.length ? $nestedSticky.height() : stickyOffset + nestedStickyTop);
if (needsUpdating) { if (needsUpdating) {
$stickyWrap $stickyWrap
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide ) .removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
@ -2576,8 +2583,8 @@
if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; } if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
// clear out cloned table, except for sticky header // clear out cloned table, except for sticky header
// include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
$stickyTable.find('thead:gt(0), tr.sticky-false').hide(); $stickyTable.find('> thead:gt(0), tr.sticky-false').hide();
$stickyTable.find('tbody, tfoot').remove(); $stickyTable.find('> tbody, > tfoot').remove();
$stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption); $stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption);
// issue #172 - find td/th in sticky header // issue #172 - find td/th in sticky header
$stickyCells = $stickyThead.children().children(); $stickyCells = $stickyThead.children().children();
@ -2609,7 +2616,6 @@
c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] ); c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] );
} }
} }
// make it sticky! // make it sticky!
$xScroll.add($yScroll) $xScroll.add($yScroll)
.unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') ) .unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') )
@ -2680,7 +2686,7 @@
})(jQuery, window); })(jQuery, window);
/*! Widget: resizable - updated 12/13/2017 (v2.29.1) */ /*! Widget: resizable - updated 2018-02-14 (v2.29.6) */
/*jshint browser:true, jquery:true, unused:false */ /*jshint browser:true, jquery:true, unused:false */
;(function ($, window) { ;(function ($, window) {
'use strict'; 'use strict';
@ -3071,7 +3077,7 @@
if ( vars.overflow && vars.tableWidth ) { if ( vars.overflow && vars.tableWidth ) {
ts.resizable.setWidth( c.$table, vars.tableWidth, true ); ts.resizable.setWidth( c.$table, vars.tableWidth, true );
if ( vars.useStorage ) { if ( vars.useStorage ) {
ts.storage( table, 'tablesorter-table-resized-width', 'auto' ); ts.storage( table, 'tablesorter-table-resized-width', vars.tableWidth );
} }
} }
for ( index = 0; index < c.columns; index++ ) { for ( index = 0; index < c.columns; index++ ) {
@ -3087,7 +3093,7 @@
// reset stickyHeader widths // reset stickyHeader widths
c.$table.triggerHandler( 'stickyHeadersUpdate' ); c.$table.triggerHandler( 'stickyHeadersUpdate' );
if ( ts.storage && !refreshing ) { if ( ts.storage && !refreshing ) {
ts.storage( this, ts.css.resizableStorage, {} ); ts.storage( this, ts.css.resizableStorage, [] );
} }
} }
}); });

View File

@ -1,4 +1,4 @@
/*! Widget: resizable - updated 12/13/2017 (v2.29.1) */ /*! Widget: resizable - updated 2018-02-14 (v2.29.6) */
/*jshint browser:true, jquery:true, unused:false */ /*jshint browser:true, jquery:true, unused:false */
;(function ($, window) { ;(function ($, window) {
'use strict'; 'use strict';
@ -389,7 +389,7 @@
if ( vars.overflow && vars.tableWidth ) { if ( vars.overflow && vars.tableWidth ) {
ts.resizable.setWidth( c.$table, vars.tableWidth, true ); ts.resizable.setWidth( c.$table, vars.tableWidth, true );
if ( vars.useStorage ) { if ( vars.useStorage ) {
ts.storage( table, 'tablesorter-table-resized-width', 'auto' ); ts.storage( table, 'tablesorter-table-resized-width', vars.tableWidth );
} }
} }
for ( index = 0; index < c.columns; index++ ) { for ( index = 0; index < c.columns; index++ ) {
@ -405,7 +405,7 @@
// reset stickyHeader widths // reset stickyHeader widths
c.$table.triggerHandler( 'stickyHeadersUpdate' ); c.$table.triggerHandler( 'stickyHeadersUpdate' );
if ( ts.storage && !refreshing ) { if ( ts.storage && !refreshing ) {
ts.storage( this, ts.css.resizableStorage, {} ); ts.storage( this, ts.css.resizableStorage, [] );
} }
} }
}); });

View File

@ -745,12 +745,18 @@
tsScroller = ts.scroller, tsScroller = ts.scroller,
fixedColumns = wo.scroller_fixedColumns, fixedColumns = wo.scroller_fixedColumns,
// get dimensions // get dimensions
getDim = function ($el, name, deflt) {
return parseInt( $el.css(name) || '', 10 ) || deflt || 0;
},
$temp = $table.find( 'tbody td' ), $temp = $table.find( 'tbody td' ),
borderRightWidth = parseInt( $temp.css( 'border-right-width' ), 10 ) || 1, borderRightWidth = getDim( $temp, 'border-right-width', 1 ),
borderSpacing = parseInt( ( $temp.css( 'border-spacing' ) || '' ).split( /\s/ )[ 0 ], 10 ) / 2 || 0, borderSpacing = getDim( $temp, 'border-spacing', 0 ),
totalWidth = parseInt( $table.css( 'padding-left' ), 10 ) + totalWidth = getDim( $table, 'padding-left' ) +
parseInt( $table.css( 'padding-right' ), 10 ) - getDim( $table, 'padding-right' ) +
borderRightWidth, // include table left & row left border
getDim( $table, 'border-left-width', 1 ) * 2 +
getDim( $table, 'border-right-width', 1 ) -
borderRightWidth + borderSpacing / 2,
widths = wo.scroller_calcWidths; widths = wo.scroller_calcWidths;
ts.scroller.removeFixed( c, wo, false ); ts.scroller.removeFixed( c, wo, false );
@ -761,7 +767,7 @@
} }
// set fixed column width // set fixed column width
totalWidth = totalWidth + borderRightWidth * 2 - borderSpacing; totalWidth = totalWidth + borderRightWidth * 2;
tsScroller.setWidth( $fixedColumn.add( $fixedColumn.children() ), totalWidth ); tsScroller.setWidth( $fixedColumn.add( $fixedColumn.children() ), totalWidth );
tsScroller.setWidth( $fixedColumn.children().children( 'table' ), totalWidth ); tsScroller.setWidth( $fixedColumn.children().children( 'table' ), totalWidth );
@ -799,7 +805,6 @@
.css( 'width', totalWidth + adj ); .css( 'width', totalWidth + adj );
} }
$fixedColumn.removeClass( tscss.scrollerHideElement );
for ( index = 0; index < fixedColumns; index++ ) { for ( index = 0; index < fixedColumns; index++ ) {
temp = ':nth-child(' + ( index + 1 ) + ')'; temp = ':nth-child(' + ( index + 1 ) + ')';
$wrapper $wrapper
@ -808,6 +813,14 @@
.find( 'th' + temp + ', td' + temp + ', col' + temp ) .find( 'th' + temp + ', td' + temp + ', col' + temp )
.addClass( tscss.scrollerHideColumn ); .addClass( tscss.scrollerHideColumn );
} }
$fixedColumn
.removeClass( tscss.scrollerHideElement )
.find('colgroup')
.each(function() {
$(this)
.find('col:gt(' + (fixedColumns - 1) + ')')
.addClass( tscss.scrollerHideElement );
});
totalWidth = totalWidth - borderRightWidth; totalWidth = totalWidth - borderRightWidth;
temp = $tableWrap.parent().innerWidth() - totalWidth; temp = $tableWrap.parent().innerWidth() - totalWidth;

View File

@ -90,7 +90,7 @@
var index, len, $t, var index, len, $t,
$table = c.$table, $table = c.$table,
// add position: relative to attach element, hopefully it won't cause trouble. // add position: relative to attach element, hopefully it won't cause trouble.
$attach = $(wo.stickyHeaders_attachTo), $attach = $(wo.stickyHeaders_attachTo || wo.stickyHeaders_appendTo),
namespace = c.namespace + 'stickyheaders ', namespace = c.namespace + 'stickyheaders ',
// element to watch for the scroll event // element to watch for the scroll event
$yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window), $yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window),
@ -150,7 +150,10 @@
}); });
} }
}, },
getLeftPosition = function() { getLeftPosition = function(yWindow) {
if (yWindow === false && $nestedSticky.length) {
return $table.position().left;
}
return $attach.length ? return $attach.length ?
parseInt($attach.css('padding-left'), 10) || 0 : parseInt($attach.css('padding-left'), 10) || 0 :
$table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft(); $table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft();
@ -171,9 +174,11 @@
offset = $table.offset(), offset = $table.offset(),
stickyOffset = getStickyOffset(c, wo), stickyOffset = getStickyOffset(c, wo),
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3 yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
attachTop = $attach.length ? yScroll = yWindow ?
( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) : $yScroll.scrollTop() :
$yScroll.scrollTop(), // use parent sticky position if nested AND inside of a scrollable element - see #1512
$nestedSticky.length ? parseInt($nestedSticky[0].style.top, 10) : $yScroll.offset().top,
attachTop = $attach.length ? yScroll : $yScroll.scrollTop(),
captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0, captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0,
scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight, scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight,
tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight, tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight,
@ -187,12 +192,14 @@
cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop(); cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
} }
// adjust when scrolling horizontally - fixes issue #143 // adjust when scrolling horizontally - fixes issue #143
tmp = getLeftPosition(); tmp = getLeftPosition(yWindow);
if (tmp !== parseInt($stickyWrap.css('left'), 10)) { if (tmp !== parseInt($stickyWrap.css('left'), 10)) {
needsUpdating = true; needsUpdating = true;
cssSettings.left = tmp; cssSettings.left = tmp;
} }
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop; cssSettings.top = ( cssSettings.top || 0 ) +
// If nested AND inside of a scrollable element, only add parent sticky height
(!yWindow && $nestedSticky.length ? $nestedSticky.height() : stickyOffset + nestedStickyTop);
if (needsUpdating) { if (needsUpdating) {
$stickyWrap $stickyWrap
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide ) .removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
@ -213,8 +220,8 @@
if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; } if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
// clear out cloned table, except for sticky header // clear out cloned table, except for sticky header
// include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
$stickyTable.find('thead:gt(0), tr.sticky-false').hide(); $stickyTable.find('> thead:gt(0), tr.sticky-false').hide();
$stickyTable.find('tbody, tfoot').remove(); $stickyTable.find('> tbody, > tfoot').remove();
$stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption); $stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption);
// issue #172 - find td/th in sticky header // issue #172 - find td/th in sticky header
$stickyCells = $stickyThead.children().children(); $stickyCells = $stickyThead.children().children();
@ -246,7 +253,6 @@
c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] ); c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] );
} }
} }
// make it sticky! // make it sticky!
$xScroll.add($yScroll) $xScroll.add($yScroll)
.unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') ) .unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') )

View File

@ -1,7 +1,7 @@
{ {
"name": "tablesorter", "name": "tablesorter",
"title": "tablesorter", "title": "tablesorter",
"version": "2.29.5", "version": "2.29.6",
"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.", "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": { "author": {
"name": "Christian Bach", "name": "Christian Bach",

View File

@ -1,7 +1,7 @@
{ {
"name": "tablesorter", "name": "tablesorter",
"title": "tablesorter", "title": "tablesorter",
"version": "2.29.5", "version": "2.29.6",
"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.", "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": { "author": {
"name": "Christian Bach", "name": "Christian Bach",