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
d445fee6e9
16
README.md
16
README.md
@ -104,6 +104,15 @@ If you would like to contribute, please...
|
||||
|
||||
View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes).
|
||||
|
||||
#### <a name="v2.30.6">Version 2.30.6</a> (2018-06-16)
|
||||
|
||||
* CssStickyHeaders:
|
||||
* Reinitialize after update. Fixes [issue #1553](https://github.com/Mottie/tablesorter/issues/1553).
|
||||
* Parser:
|
||||
* Prevent input-select error. Fixes [issue #1554](https://github.com/Mottie/tablesorter/issues/1554).
|
||||
* Docs:
|
||||
* Add lazyload warnings. See [issue #1169](https://github.com/Mottie/tablesorter/issues/1169).
|
||||
|
||||
#### <a name="v2.30.5">Version 2.30.5</a> (2018-05-28)
|
||||
|
||||
* Core:
|
||||
@ -119,10 +128,3 @@ View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/C
|
||||
* Set scrollLeft position after sort. Fixes [issue #1545](https://github.com/Mottie/tablesorter/issues/1545).
|
||||
* Docs:
|
||||
* Add when not to use headers. See [issue #1524](https://github.com/Mottie/tablesorter/issues/1524).
|
||||
|
||||
#### <a name="v2.30.3">Version 2.30.3</a> (2018-04-30)
|
||||
|
||||
* Core:
|
||||
* Use indexed headers. Fixes [issue #1524](https://github.com/Mottie/tablesorter/issues/1524).
|
||||
* Docs:
|
||||
* Remove link preload because it isn't supported in Firefox.
|
||||
|
6
dist/js/jquery.tablesorter.combined.js
vendored
6
dist/js/jquery.tablesorter.combined.js
vendored
@ -1,4 +1,4 @@
|
||||
/*! tablesorter (FORK) - updated 2018-05-28 (v2.30.5)*/
|
||||
/*! tablesorter (FORK) - updated 2018-06-16 (v2.30.6)*/
|
||||
/* 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.30.5 *//*
|
||||
/*! TableSorter (FORK) v2.30.6 *//*
|
||||
* Client-side table sorting with ease!
|
||||
* @requires jQuery v1.2.6+
|
||||
*
|
||||
@ -34,7 +34,7 @@
|
||||
'use strict';
|
||||
var ts = $.tablesorter = {
|
||||
|
||||
version : '2.30.5',
|
||||
version : '2.30.6',
|
||||
|
||||
parsers : [],
|
||||
widgets : [],
|
||||
|
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
4
dist/js/jquery.tablesorter.js
vendored
4
dist/js/jquery.tablesorter.js
vendored
@ -8,7 +8,7 @@
|
||||
}
|
||||
}(function(jQuery) {
|
||||
|
||||
/*! TableSorter (FORK) v2.30.5 *//*
|
||||
/*! TableSorter (FORK) v2.30.6 *//*
|
||||
* Client-side table sorting with ease!
|
||||
* @requires jQuery v1.2.6+
|
||||
*
|
||||
@ -32,7 +32,7 @@
|
||||
'use strict';
|
||||
var ts = $.tablesorter = {
|
||||
|
||||
version : '2.30.5',
|
||||
version : '2.30.6',
|
||||
|
||||
parsers : [],
|
||||
widgets : [],
|
||||
|
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
2
dist/js/jquery.tablesorter.widgets.js
vendored
2
dist/js/jquery.tablesorter.widgets.js
vendored
@ -1,4 +1,4 @@
|
||||
/*! tablesorter (FORK) - updated 2018-05-28 (v2.30.5)*/
|
||||
/*! tablesorter (FORK) - updated 2018-06-16 (v2.30.6)*/
|
||||
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
|
2
dist/js/jquery.tablesorter.widgets.min.js
vendored
2
dist/js/jquery.tablesorter.widgets.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/js/parsers/parser-input-select.min.js
vendored
4
dist/js/parsers/parser-input-select.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
/*! Widget: cssStickyHeaders - updated 5/24/2017 (v2.28.11) */
|
||||
!function(e,t){"use strict";var s=e.tablesorter;s.addWidget({id:"cssStickyHeaders",priority:10,options:{cssStickyHeaders_offset:0,cssStickyHeaders_addCaption:!1,cssStickyHeaders_attachTo:null,cssStickyHeaders_filteredToTop:!0},init:function(i,a,r,c){var d,o,n=r.$table,l=e(c.cssStickyHeaders_attachTo),p="ActiveXObject"in t||t.navigator.userAgent.indexOf("Edge")>-1,h=r.namespace+"cssstickyheader ",f=n.children("thead"),g=n.children("caption"),k=l.length?l:e(t),y=n.parent().closest("table."+s.css.table),H=y.length&&s.hasWidget(y[0],"cssStickyHeaders")?y.children("thead"):[],S=parseInt(n.css("border-top-width"),10)||0,b=n.height(),u=c.cssStickyHeaders_addCaption,_=!1,m=!1,C=function(e,t){var s=0===t?"":"translate(0px,"+t+"px)";e.css({transform:s,"-ms-transform":s,"-webkit-transform":s})};g.length&&(g.hide(),m=n.height()===b,g.show(),d=n.offset().top,C(g,20),_=n.offset().top!==d,C(g,0)),k.unbind("scroll resize ".split(" ").join(h).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(h),function(){c=r.widgetOptions,_&&(C(g,0),o=n.offset().top),k.scrollTop()<g.outerHeight(!0)&&(b=n.height());var e=l.length?l.offset().top:k.scrollTop(),t=(g.outerHeight(!0)||0)+(parseInt(n.css("padding-top"),10)||0)+(parseInt(n.css("border-spacing"),10)||0),s=b+(m&&c.cssStickyHeaders_addCaption?t:0)-f.height()-(n.children("tfoot").height()||0)-(c.cssStickyHeaders_addCaption?t:m?0:t),i=H.length?H.height():0,a=H.length?p?y.data("cssStickyHeaderBottom")+i:H.offset().top+i-k.scrollTop():0,d=_?o:n.offset().top,h=e-(m?d-(c.cssStickyHeaders_addCaption?t:0):d)+a+S+(c.cssStickyHeaders_offset||0)-(c.cssStickyHeaders_addCaption?m?t:0:t),T=h>0&&h<=s?h:0,v=p?f.children().children():f;p&&r.$table.data("cssStickyHeaderBottom",(H.length?i:0)-(c.cssStickyHeaders_addCaption?t:0)),c.cssStickyHeaders_addCaption&&(v=v.add(g)),u!==c.cssStickyHeaders_addCaption&&((u=c.cssStickyHeaders_addCaption)||C(g,0)),C(v,T)}),n.unbind(("filterEnd"+h).replace(/\s+/g," ")).bind("filterEnd"+h,function(){c.cssStickyHeaders_filteredToTop&&t.scrollTo(0,n.position().top)})},remove:function(s,i,a,r){if(!r){var c=i.namespace+"cssstickyheader ";e(t).unbind("scroll resize ".split(" ").join(c).replace(/\s+/g," ")),i.$table.unbind("filterEnd scroll resize ".split(" ").join(c).replace(/\s+/g," ")).add(i.$table.children("thead").children().children()).children("thead, caption").css({transform:"","-ms-transform":"","-webkit-transform":""})}}})}(jQuery,window);
|
||||
/*! Widget: cssStickyHeaders - updated 6/16/2018 (v2.30.6) */
|
||||
!function(e,t){"use strict";function s(a,d){var o,c,n=a.$table,r=e(d.cssStickyHeaders_attachTo),l="ActiveXObject"in t||t.navigator.userAgent.indexOf("Edge")>-1,p=a.namespace+"cssstickyheader ",h=n.children("thead"),f=n.children("caption"),g=r.length?r:e(t),k=n.parent().closest("table."+i.css.table),y=k.length&&i.hasWidget(k[0],"cssStickyHeaders")?k.children("thead"):[],H=parseInt(n.css("border-top-width"),10)||0,u=n.height(),S=d.cssStickyHeaders_addCaption,b=!1,m=!1,_=function(e,t){var s=0===t?"":"translate(0px,"+t+"px)";e.css({transform:s,"-ms-transform":s,"-webkit-transform":s})};f.length&&(f.hide(),m=n.height()===u,f.show(),o=n.offset().top,_(f,20),b=n.offset().top!==o,_(f,0)),g.unbind("scroll resize ".split(" ").join(p).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(p),function(){d=a.widgetOptions,b&&(_(f,0),c=n.offset().top),g.scrollTop()<f.outerHeight(!0)&&(u=n.height());var e=r.length?r.offset().top:g.scrollTop(),t=(f.outerHeight(!0)||0)+(parseInt(n.css("padding-top"),10)||0)+(parseInt(n.css("border-spacing"),10)||0),s=u+(m&&d.cssStickyHeaders_addCaption?t:0)-h.height()-(n.children("tfoot").height()||0)-(d.cssStickyHeaders_addCaption?t:m?0:t),i=y.length?y.height():0,o=y.length?l?k.data("cssStickyHeaderBottom")+i:y.offset().top+i-g.scrollTop():0,p=b?c:n.offset().top,C=e-(m?p-(d.cssStickyHeaders_addCaption?t:0):p)+o+H+(d.cssStickyHeaders_offset||0)-(d.cssStickyHeaders_addCaption?m?t:0:t),T=C>0&&C<=s?C:0,v=l?h.children().children():h;l&&a.$table.data("cssStickyHeaderBottom",(y.length?i:0)-(d.cssStickyHeaders_addCaption?t:0)),d.cssStickyHeaders_addCaption&&(v=v.add(f)),S!==d.cssStickyHeaders_addCaption&&((S=d.cssStickyHeaders_addCaption)||_(f,0)),_(v,T)}),n.unbind("filterEnd updateComplete ".split(" ").join(p).replace(/\s+/g," ")).bind("filterEnd"+p,function(){d.cssStickyHeaders_filteredToTop&&t.scrollTo(0,n.position().top)}).bind("updateComplete"+p,function(){s(a,a.widgetOptions)})}var i=e.tablesorter;i.addWidget({id:"cssStickyHeaders",priority:10,options:{cssStickyHeaders_offset:0,cssStickyHeaders_addCaption:!1,cssStickyHeaders_attachTo:null,cssStickyHeaders_filteredToTop:!0},init:function(e,t,i,a){s(i,a)},remove:function(s,i,a,d){if(!d){var o=i.namespace+"cssstickyheader ";e(t).unbind("scroll resize ".split(" ").join(o).replace(/\s+/g," ")),i.$table.unbind("filterEnd scroll resize updateComplete ".split(" ").join(o).replace(/\s+/g," ")).add(i.$table.children("thead").children().children()).children("thead, caption").css({transform:"","-ms-transform":"","-webkit-transform":""})}}})}(jQuery,window);
|
@ -67,6 +67,9 @@
|
||||
|
||||
<h3><a href="#">Notes</a></h3>
|
||||
<div>
|
||||
<p>
|
||||
<span class="label warning">Warning</span> Binding the <a class="intlink" href="#lazyload_event"><code>lazyload_event</code></a> to <code>'scroll'</code> may cause excessive lag.
|
||||
</p>
|
||||
<ul>
|
||||
<li>This widget, added in <span class="version">v2.24.0</span>, integrates the popular <a class="external" href="https://github.com/tuupola/jquery_lazyload">jQuery lazyload plugin</a> & <a class="external" href="https://github.com/ssorallen/jquery-scrollstop">jQuery scrollstop</a>.</li>
|
||||
<li>This widget will only work if:
|
||||
@ -157,7 +160,7 @@
|
||||
<td>
|
||||
By default images are loaded when they appear on the screen.
|
||||
<div class="collapsible">
|
||||
<p>If you want images to load earlier use threshold parameter. Setting threshold to 200 causes image to load 200 pixels before it appears on viewport.</p>
|
||||
<p>If you want images to load earlier use threshold parameter. Setting threshold to <code>200</code> causes image to load 200 pixels before it appears on viewport.</p>
|
||||
For more details, see the <a class="external" href="http://www.appelsiini.net/projects/lazyload#setting-threshold">main documentation</a>.
|
||||
</div>
|
||||
</td>
|
||||
@ -179,9 +182,10 @@
|
||||
<td>
|
||||
Event to trigger image loading.
|
||||
<div class="collapsible">
|
||||
<p>In the original plugin, the default for this option is "scroll". It was changed to "scrollstop" in this widget to only load images after scrolling stops.</p>
|
||||
<p>Alternative settings include "click" (user clicks on image to load it) or "mouseover".</p>
|
||||
<p>If this option is not set to "scrollstop", then the scrollstop plugin will not be initialized.</p>
|
||||
<p>In the original plugin, the default for this option is <code>'scroll'</code>. It was changed to <code>'scrollstop'</code> in this widget to only load images after scrolling stops.</p>
|
||||
<p>Alternative settings include <code>'click'</code> (user clicks on image to load it) or <code>'mouseover'</code>.</p>
|
||||
<p>If this option is not set to <code>'scrollstop'</code>, then the scrollstop plugin will not be initialized.</p>
|
||||
<p><span class="label warning">Warning</span> If the option is set to <code>'scroll'</code>, the plugin may cause excessive lag.</p>
|
||||
For more details, see the <a class="external" href="http://www.appelsiini.net/projects/lazyload#event-to-trigger-loading">main documentation</a>.
|
||||
</div>
|
||||
</td>
|
||||
|
@ -517,7 +517,7 @@
|
||||
<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.29.0</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><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.30.6</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.30.0</span>).</li>
|
||||
|
||||
@ -546,7 +546,7 @@
|
||||
<li><a href="example-parsers-file-type.html">File type & extension parsers</a> (<span class="version">v2.13</span>; <span class="version updated">v2.24.4</span>).</li>
|
||||
<li><a href="example-parsers-named-numbers.html">Huge Numbers parser</a> (<span class="version">v2.25.5</span>).</li>
|
||||
<li><a href="example-parsers-ignore-articles.html">Ignore leading articles parser</a> (Ignore "A", "An" and "The" in titles) (<span class="version">v2.8</span>).</li>
|
||||
<li><a href="example-widget-grouping.html">Input/select parsers</a> (used by Grouping rows widget) (<span class="version">v2.8</span>; <span class="version updated">v2.29.5</span>).</li>
|
||||
<li><a href="example-widget-grouping.html">Input/select parsers</a> (used by Grouping rows widget) (<span class="version">v2.8</span>; <span class="version updated">v2.30.6</span>).</li>
|
||||
<li><a href="example-parsers-globalize.html">jQuery Globalize</a> (number & date parsers; <span class="version">v2.22.0</span>; <span class="version updated">v2.25.0</span>).</li>
|
||||
<li><a href="example-parsers-leading-zeros.html">Leading zeros parser</a> (<span class="version">v2.28.6</span>).</li>
|
||||
<li><a href="example-parsers-metric.html">Metric parser</a> (<span class="version">v2.8</span>).</li>
|
||||
|
@ -4,7 +4,7 @@
|
||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
||||
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
||||
*/
|
||||
/*! tablesorter (FORK) - updated 2018-05-28 (v2.30.5)*/
|
||||
/*! tablesorter (FORK) - updated 2018-06-16 (v2.30.6)*/
|
||||
/* 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.30.5 *//*
|
||||
/*! TableSorter (FORK) v2.30.6 *//*
|
||||
* Client-side table sorting with ease!
|
||||
* @requires jQuery v1.2.6+
|
||||
*
|
||||
@ -40,7 +40,7 @@
|
||||
'use strict';
|
||||
var ts = $.tablesorter = {
|
||||
|
||||
version : '2.30.5',
|
||||
version : '2.30.6',
|
||||
|
||||
parsers : [],
|
||||
widgets : [],
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*! TableSorter (FORK) v2.30.5 *//*
|
||||
/*! TableSorter (FORK) v2.30.6 *//*
|
||||
* Client-side table sorting with ease!
|
||||
* @requires jQuery v1.2.6+
|
||||
*
|
||||
@ -22,7 +22,7 @@
|
||||
'use strict';
|
||||
var ts = $.tablesorter = {
|
||||
|
||||
version : '2.30.5',
|
||||
version : '2.30.6',
|
||||
|
||||
parsers : [],
|
||||
widgets : [],
|
||||
|
@ -4,7 +4,7 @@
|
||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
||||
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
||||
*/
|
||||
/*! tablesorter (FORK) - updated 2018-05-28 (v2.30.5)*/
|
||||
/*! tablesorter (FORK) - updated 2018-06-16 (v2.30.6)*/
|
||||
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*! Parser: input & select - updated 2018-03-03 (v2.30.2) *//*
|
||||
/*! Parser: input & select - updated 2018-06-16 (v2.30.6) *//*
|
||||
* for jQuery 1.7+ & tablesorter 2.7.11+
|
||||
* Demo: http://mottie.github.com/tablesorter/docs/example-widget-grouping.html
|
||||
*/
|
||||
@ -145,7 +145,7 @@
|
||||
}
|
||||
},
|
||||
updateCheckbox = function($el, state) {
|
||||
if ($el[0].nodeName !== 'INPUT') {
|
||||
if ($el.length && $el[0].nodeName !== 'INPUT') {
|
||||
$el = $el.find( 'input[type="checkbox"]' );
|
||||
}
|
||||
if ($el.length) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*! Widget: cssStickyHeaders - updated 5/24/2017 (v2.28.11) *//*
|
||||
/*! Widget: cssStickyHeaders - updated 6/16/2018 (v2.30.6) *//*
|
||||
* Requires a modern browser, tablesorter v2.8+
|
||||
*/
|
||||
/*jshint jquery:true, unused:false */
|
||||
@ -7,6 +7,136 @@
|
||||
|
||||
var ts = $.tablesorter;
|
||||
|
||||
function cssStickyHeadersInit(c, wo) {
|
||||
var offst, adjustY,
|
||||
$table = c.$table,
|
||||
$attach = $(wo.cssStickyHeaders_attachTo),
|
||||
// target all versions of IE
|
||||
isIE = 'ActiveXObject' in window || window.navigator.userAgent.indexOf('Edge') > -1,
|
||||
namespace = c.namespace + 'cssstickyheader ',
|
||||
$thead = $table.children('thead'),
|
||||
$caption = $table.children('caption'),
|
||||
$win = $attach.length ? $attach : $(window),
|
||||
$parent = $table.parent().closest('table.' + ts.css.table),
|
||||
$parentThead = $parent.length && ts.hasWidget($parent[0], 'cssStickyHeaders') ? $parent.children('thead') : [],
|
||||
borderTopWidth = ( parseInt( $table.css('border-top-width'), 10 ) || 0 ),
|
||||
// Fixes for Safari
|
||||
tableH = $table.height(),
|
||||
lastCaptionSetting = wo.cssStickyHeaders_addCaption,
|
||||
// table offset top changes while scrolling in FF
|
||||
adjustOffsetTop = false,
|
||||
addCaptionHeight = false,
|
||||
setTransform = function( $elms, y ) {
|
||||
var translate = y === 0 ? '' : 'translate(0px,' + y + 'px)';
|
||||
$elms.css({
|
||||
'transform' : translate,
|
||||
'-ms-transform' : translate,
|
||||
'-webkit-transform' : translate
|
||||
});
|
||||
};
|
||||
|
||||
// Firefox fixes
|
||||
if ($caption.length) {
|
||||
// Firefox does not include the caption height when getting the table height
|
||||
// see https://bugzilla.mozilla.org/show_bug.cgi?id=820891, so lets detect it instead of browser sniff
|
||||
$caption.hide();
|
||||
addCaptionHeight = $table.height() === tableH;
|
||||
$caption.show();
|
||||
|
||||
// Firefox changes the offset().top when translating the table caption
|
||||
offst = $table.offset().top;
|
||||
setTransform( $caption, 20 );
|
||||
adjustOffsetTop = $table.offset().top !== offst;
|
||||
setTransform( $caption, 0 );
|
||||
}
|
||||
|
||||
$win
|
||||
.unbind( ('scroll resize '.split(' ').join(namespace)).replace(/\s+/g, ' ') )
|
||||
.bind('scroll resize '.split(' ').join(namespace), function() {
|
||||
// make sure "wo" is current otherwise changes to widgetOptions
|
||||
// are not dynamic (like the add caption button in the demo)
|
||||
wo = c.widgetOptions;
|
||||
|
||||
if ( adjustOffsetTop ) {
|
||||
// remove transform from caption to get the correct offset().top value
|
||||
setTransform( $caption, 0 );
|
||||
adjustY = $table.offset().top;
|
||||
}
|
||||
|
||||
// Fix for safari, when caption present, table
|
||||
// height changes while scrolling
|
||||
if ($win.scrollTop() < $caption.outerHeight(true)) {
|
||||
tableH = $table.height();
|
||||
}
|
||||
|
||||
var top = $attach.length ? $attach.offset().top : $win.scrollTop(),
|
||||
// add caption height; include table padding top & border-spacing or text may be above the fold (jQuery UI themes)
|
||||
// border-spacing needed in Firefox, but not webkit... not sure if I should account for that
|
||||
captionHeight = ( $caption.outerHeight(true) || 0 ) +
|
||||
( parseInt( $table.css('padding-top'), 10 ) || 0 ) +
|
||||
( parseInt( $table.css('border-spacing'), 10 ) || 0 ),
|
||||
|
||||
bottom = tableH + ( addCaptionHeight && wo.cssStickyHeaders_addCaption ? captionHeight : 0 ) -
|
||||
$thead.height() - ( $table.children('tfoot').height() || 0 ) -
|
||||
( wo.cssStickyHeaders_addCaption ? captionHeight : ( addCaptionHeight ? 0 : captionHeight ) ),
|
||||
|
||||
parentTheadHeight = $parentThead.length ? $parentThead.height() : 0,
|
||||
|
||||
// get bottom of nested sticky headers
|
||||
nestedStickyBottom = $parentThead.length ? (
|
||||
isIE ? $parent.data('cssStickyHeaderBottom') + parentTheadHeight :
|
||||
$parentThead.offset().top + parentTheadHeight - $win.scrollTop()
|
||||
) : 0,
|
||||
|
||||
// in this case FF's offsetTop changes while scrolling, so we get a saved offsetTop before scrolling occurs
|
||||
// but when the table is inside a wrapper ($attach) we need to continually update the offset top
|
||||
tableOffsetTop = adjustOffsetTop ? adjustY : $table.offset().top,
|
||||
|
||||
offsetTop = addCaptionHeight ? tableOffsetTop - ( wo.cssStickyHeaders_addCaption ? captionHeight : 0 ) : tableOffsetTop,
|
||||
|
||||
// Detect nested tables - fixes #724
|
||||
deltaY = top - offsetTop + nestedStickyBottom + borderTopWidth + ( wo.cssStickyHeaders_offset || 0 ) -
|
||||
( wo.cssStickyHeaders_addCaption ? ( addCaptionHeight ? captionHeight : 0 ) : captionHeight ),
|
||||
|
||||
finalY = deltaY > 0 && deltaY <= bottom ? deltaY : 0,
|
||||
|
||||
// All IE (even IE11) can only transform header cells - fixes #447 thanks to @gakreol!
|
||||
$cells = isIE ? $thead.children().children() : $thead;
|
||||
|
||||
// more crazy IE stuff...
|
||||
if (isIE) {
|
||||
// I didn't bother testing 3 nested tables deep in IE, because I hate it
|
||||
c.$table.data( 'cssStickyHeaderBottom', ( $parentThead.length ? parentTheadHeight : 0 ) -
|
||||
( wo.cssStickyHeaders_addCaption ? captionHeight : 0 ) );
|
||||
}
|
||||
|
||||
if (wo.cssStickyHeaders_addCaption) {
|
||||
$cells = $cells.add($caption);
|
||||
}
|
||||
if (lastCaptionSetting !== wo.cssStickyHeaders_addCaption) {
|
||||
lastCaptionSetting = wo.cssStickyHeaders_addCaption;
|
||||
// reset caption position if addCaption option is dynamically changed to false
|
||||
if (!lastCaptionSetting) {
|
||||
setTransform( $caption, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
setTransform( $cells, finalY );
|
||||
|
||||
});
|
||||
$table
|
||||
.unbind( ('filterEnd updateComplete '.split(' ').join(namespace)).replace(/\s+/g, ' ') )
|
||||
.bind('filterEnd' + namespace, function() {
|
||||
if (wo.cssStickyHeaders_filteredToTop) {
|
||||
// scroll top of table into view
|
||||
window.scrollTo(0, $table.position().top);
|
||||
}
|
||||
})
|
||||
.bind('updateComplete' + namespace, function() {
|
||||
cssStickyHeadersInit(c, c.widgetOptions);
|
||||
});
|
||||
}
|
||||
|
||||
ts.addWidget({
|
||||
id: 'cssStickyHeaders',
|
||||
priority: 10,
|
||||
@ -18,138 +148,14 @@
|
||||
cssStickyHeaders_filteredToTop : true
|
||||
},
|
||||
init : function(table, thisWidget, c, wo) {
|
||||
var offst, adjustY,
|
||||
$table = c.$table,
|
||||
$attach = $(wo.cssStickyHeaders_attachTo),
|
||||
// target all versions of IE
|
||||
isIE = 'ActiveXObject' in window || window.navigator.userAgent.indexOf('Edge') > -1,
|
||||
namespace = c.namespace + 'cssstickyheader ',
|
||||
$thead = $table.children('thead'),
|
||||
$caption = $table.children('caption'),
|
||||
$win = $attach.length ? $attach : $(window),
|
||||
$parent = $table.parent().closest('table.' + ts.css.table),
|
||||
$parentThead = $parent.length && ts.hasWidget($parent[0], 'cssStickyHeaders') ? $parent.children('thead') : [],
|
||||
borderTopWidth = ( parseInt( $table.css('border-top-width'), 10 ) || 0 ),
|
||||
// Fixes for Safari
|
||||
tableH = $table.height(),
|
||||
lastCaptionSetting = wo.cssStickyHeaders_addCaption,
|
||||
// table offset top changes while scrolling in FF
|
||||
adjustOffsetTop = false,
|
||||
addCaptionHeight = false,
|
||||
setTransform = function( $elms, y ) {
|
||||
var translate = y === 0 ? '' : 'translate(0px,' + y + 'px)';
|
||||
$elms.css({
|
||||
'transform' : translate,
|
||||
'-ms-transform' : translate,
|
||||
'-webkit-transform' : translate
|
||||
});
|
||||
};
|
||||
|
||||
// Firefox fixes
|
||||
if ($caption.length) {
|
||||
// Firefox does not include the caption height when getting the table height
|
||||
// see https://bugzilla.mozilla.org/show_bug.cgi?id=820891, so lets detect it instead of browser sniff
|
||||
$caption.hide();
|
||||
addCaptionHeight = $table.height() === tableH;
|
||||
$caption.show();
|
||||
|
||||
// Firefox changes the offset().top when translating the table caption
|
||||
offst = $table.offset().top;
|
||||
setTransform( $caption, 20 );
|
||||
adjustOffsetTop = $table.offset().top !== offst;
|
||||
setTransform( $caption, 0 );
|
||||
}
|
||||
|
||||
$win
|
||||
.unbind( ('scroll resize '.split(' ').join(namespace)).replace(/\s+/g, ' ') )
|
||||
.bind('scroll resize '.split(' ').join(namespace), function() {
|
||||
// make sure "wo" is current otherwise changes to widgetOptions
|
||||
// are not dynamic (like the add caption button in the demo)
|
||||
wo = c.widgetOptions;
|
||||
|
||||
if ( adjustOffsetTop ) {
|
||||
// remove transform from caption to get the correct offset().top value
|
||||
setTransform( $caption, 0 );
|
||||
adjustY = $table.offset().top;
|
||||
}
|
||||
|
||||
// Fix for safari, when caption present, table
|
||||
// height changes while scrolling
|
||||
if ($win.scrollTop() < $caption.outerHeight(true)) {
|
||||
tableH = $table.height();
|
||||
}
|
||||
|
||||
var top = $attach.length ? $attach.offset().top : $win.scrollTop(),
|
||||
// add caption height; include table padding top & border-spacing or text may be above the fold (jQuery UI themes)
|
||||
// border-spacing needed in Firefox, but not webkit... not sure if I should account for that
|
||||
captionHeight = ( $caption.outerHeight(true) || 0 ) +
|
||||
( parseInt( $table.css('padding-top'), 10 ) || 0 ) +
|
||||
( parseInt( $table.css('border-spacing'), 10 ) || 0 ),
|
||||
|
||||
bottom = tableH + ( addCaptionHeight && wo.cssStickyHeaders_addCaption ? captionHeight : 0 ) -
|
||||
$thead.height() - ( $table.children('tfoot').height() || 0 ) -
|
||||
( wo.cssStickyHeaders_addCaption ? captionHeight : ( addCaptionHeight ? 0 : captionHeight ) ),
|
||||
|
||||
parentTheadHeight = $parentThead.length ? $parentThead.height() : 0,
|
||||
|
||||
// get bottom of nested sticky headers
|
||||
nestedStickyBottom = $parentThead.length ? (
|
||||
isIE ? $parent.data('cssStickyHeaderBottom') + parentTheadHeight :
|
||||
$parentThead.offset().top + parentTheadHeight - $win.scrollTop()
|
||||
) : 0,
|
||||
|
||||
// in this case FF's offsetTop changes while scrolling, so we get a saved offsetTop before scrolling occurs
|
||||
// but when the table is inside a wrapper ($attach) we need to continually update the offset top
|
||||
tableOffsetTop = adjustOffsetTop ? adjustY : $table.offset().top,
|
||||
|
||||
offsetTop = addCaptionHeight ? tableOffsetTop - ( wo.cssStickyHeaders_addCaption ? captionHeight : 0 ) : tableOffsetTop,
|
||||
|
||||
// Detect nested tables - fixes #724
|
||||
deltaY = top - offsetTop + nestedStickyBottom + borderTopWidth + ( wo.cssStickyHeaders_offset || 0 ) -
|
||||
( wo.cssStickyHeaders_addCaption ? ( addCaptionHeight ? captionHeight : 0 ) : captionHeight ),
|
||||
|
||||
finalY = deltaY > 0 && deltaY <= bottom ? deltaY : 0,
|
||||
|
||||
// All IE (even IE11) can only transform header cells - fixes #447 thanks to @gakreol!
|
||||
$cells = isIE ? $thead.children().children() : $thead;
|
||||
|
||||
// more crazy IE stuff...
|
||||
if (isIE) {
|
||||
// I didn't bother testing 3 nested tables deep in IE, because I hate it
|
||||
c.$table.data( 'cssStickyHeaderBottom', ( $parentThead.length ? parentTheadHeight : 0 ) -
|
||||
( wo.cssStickyHeaders_addCaption ? captionHeight : 0 ) );
|
||||
}
|
||||
|
||||
if (wo.cssStickyHeaders_addCaption) {
|
||||
$cells = $cells.add($caption);
|
||||
}
|
||||
if (lastCaptionSetting !== wo.cssStickyHeaders_addCaption) {
|
||||
lastCaptionSetting = wo.cssStickyHeaders_addCaption;
|
||||
// reset caption position if addCaption option is dynamically changed to false
|
||||
if (!lastCaptionSetting) {
|
||||
setTransform( $caption, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
setTransform( $cells, finalY );
|
||||
|
||||
});
|
||||
$table
|
||||
.unbind( ('filterEnd' + namespace).replace(/\s+/g, ' ') )
|
||||
.bind('filterEnd' + namespace, function() {
|
||||
if (wo.cssStickyHeaders_filteredToTop) {
|
||||
// scroll top of table into view
|
||||
window.scrollTo(0, $table.position().top);
|
||||
}
|
||||
});
|
||||
|
||||
cssStickyHeadersInit(c, wo);
|
||||
},
|
||||
remove: function(table, c, wo, refreshing) {
|
||||
if (refreshing) { return; }
|
||||
var namespace = c.namespace + 'cssstickyheader ';
|
||||
$(window).unbind( ('scroll resize '.split(' ').join(namespace)).replace(/\s+/g, ' ') );
|
||||
c.$table
|
||||
.unbind( ('filterEnd scroll resize '.split(' ').join(namespace)).replace(/\s+/g, ' ') )
|
||||
.unbind( ('filterEnd scroll resize updateComplete '.split(' ').join(namespace)).replace(/\s+/g, ' ') )
|
||||
.add( c.$table.children('thead').children().children() )
|
||||
.children('thead, caption').css({
|
||||
'transform' : '',
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "tablesorter",
|
||||
"title": "tablesorter",
|
||||
"version": "2.30.5",
|
||||
"version": "2.30.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.",
|
||||
"author": {
|
||||
"name": "Christian Bach",
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "tablesorter",
|
||||
"title": "tablesorter",
|
||||
"version": "2.30.5",
|
||||
"version": "2.30.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.",
|
||||
"author": {
|
||||
"name": "Christian Bach",
|
||||
|
Loading…
Reference in New Issue
Block a user