Skip to content

Commit 541fe73

Browse files
committed
Update tablesorter to latest version (2.28.13)
1 parent 3125b8d commit 541fe73

File tree

8 files changed

+112
-70
lines changed

8 files changed

+112
-70
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
===
33

4+
#### v1.23.13 (2017-06-06)
5+
6+
* Upgrade tablesorter to v2.28.13
7+
48
#### v1.23.12 (2017-05-29)
59

610
* Upgrade tablesorter to v2.28.12

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Simple integration of jQuery tablesorter ([Mottie's fork]) into the asset pipeline.
66

7-
Current tablesorter version: 2.28.12 (5/26/2017), [documentation]
7+
Current tablesorter version: 2.28.13 (6/2/2017) [documentation]
88

99
Any issue associated with the js/css files, please report to [Mottie's fork].
1010

lib/jquery-tablesorter/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module JqueryTablesorter
22
MAJOR = 1
33
MINOR = 23
4-
TINY = 12
4+
TINY = 13
55

66
VERSION = [MAJOR, MINOR, TINY].compact.join('.')
77
end

vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.combined.js

+45-28
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
55
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
66
*/
7-
/*! tablesorter (FORK) - updated 05-26-2017 (v2.28.12)*/
7+
/*! tablesorter (FORK) - updated 06-02-2017 (v2.28.13)*/
88
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
99
(function(factory) {
1010
if (typeof define === 'function' && define.amd) {
@@ -16,7 +16,7 @@
1616
}
1717
}(function(jQuery) {
1818

19-
/*! TableSorter (FORK) v2.28.12 *//*
19+
/*! TableSorter (FORK) v2.28.13 *//*
2020
* Client-side table sorting with ease!
2121
* @requires jQuery v1.2.6+
2222
*
@@ -40,7 +40,7 @@
4040
'use strict';
4141
var ts = $.tablesorter = {
4242

43-
version : '2.28.12',
43+
version : '2.28.13',
4444

4545
parsers : [],
4646
widgets : [],
@@ -116,6 +116,7 @@
116116
cssIconNone : '', // class name added to the icon when there is no column sort
117117
cssIconAsc : '', // class name added to the icon when the column has an ascending sort
118118
cssIconDesc : '', // class name added to the icon when the column has a descending sort
119+
cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
119120

120121
// *** events
121122
pointerClick : 'click',
@@ -1092,28 +1093,40 @@
10921093
▀████▀ ██ █████▀ ██ ██ ██ ██████
10931094
*/
10941095
setHeadersCss : function( c ) {
1095-
var $sorted, indx, column,
1096+
var indx, column,
10961097
list = c.sortList,
10971098
len = list.length,
10981099
none = ts.css.sortNone + ' ' + c.cssNone,
10991100
css = [ ts.css.sortAsc + ' ' + c.cssAsc, ts.css.sortDesc + ' ' + c.cssDesc ],
11001101
cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
11011102
aria = [ 'ascending', 'descending' ],
11021103
// find the footer
1103-
$headers = c.$table
1104+
$extras = c.$table
11041105
.find( 'tfoot tr' )
11051106
.children( 'td, th' )
11061107
.add( $( c.namespace + '_extra_headers' ) )
1107-
.removeClass( css.join( ' ' ) );
1108-
// remove all header information
1109-
c.$headers
1110-
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
1111-
.removeClass( css.join( ' ' ) )
1112-
.addClass( none )
1113-
.attr( 'aria-sort', 'none' )
1108+
.removeClass( css.join( ' ' ) ),
1109+
// remove all header information
1110+
$sorted = c.$headers
1111+
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
1112+
.removeClass( css.join( ' ' ) )
1113+
.addClass( none )
1114+
.attr( 'aria-sort', 'none' )
1115+
.find( '.' + ts.css.icon )
1116+
.removeClass( cssIcon.join( ' ' ) )
1117+
.end();
1118+
// add css none to all sortable headers
1119+
$sorted
1120+
.not( '.sorter-false' )
11141121
.find( '.' + ts.css.icon )
1115-
.removeClass( cssIcon.join( ' ' ) )
11161122
.addClass( cssIcon[ 2 ] );
1123+
// add disabled css icon class
1124+
if ( c.cssIconDisabled ) {
1125+
$sorted
1126+
.filter( '.sorter-false' )
1127+
.find( '.' + ts.css.icon )
1128+
.addClass( c.cssIconDisabled );
1129+
}
11171130
for ( indx = 0; indx < len; indx++ ) {
11181131
// direction = 2 means reset!
11191132
if ( list[ indx ][ 1 ] !== 2 ) {
@@ -1150,8 +1163,8 @@
11501163
}
11511164
}
11521165
// add sorted class to footer & extra headers, if they exist
1153-
if ( $headers.length ) {
1154-
$headers
1166+
if ( $extras.length ) {
1167+
$extras
11551168
.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' )
11561169
.removeClass( none )
11571170
.addClass( css[ list[ indx ][ 1 ] ] );
@@ -1824,10 +1837,10 @@
18241837
},
18251838

18261839
// Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
1827-
// this function will only accept strings, or you'll see 'TypeError: undefined is not a function'
1828-
// I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall
18291840
sortNatural : function( a, b ) {
18301841
if ( a === b ) { return 0; }
1842+
a = a.toString();
1843+
b = b.toString();
18311844
var aNum, bNum, aFloat, bFloat, indx, max,
18321845
regex = ts.regex;
18331846
// first try and sort Hex codes
@@ -5152,7 +5165,7 @@
51525165

51535166
})( jQuery );
51545167

5155-
/*! Widget: stickyHeaders - updated 1/6/2017 (v2.28.4) *//*
5168+
/*! Widget: stickyHeaders - updated 6/2/2017 (v2.28.13) *//*
51565169
* Requires tablesorter v2.8+ and jQuery 1.4.3+
51575170
* by Rob Garrison
51585171
*/
@@ -5209,6 +5222,13 @@
52095222
}, options.timer);
52105223
};
52115224

5225+
function getStickyOffset(c, wo) {
5226+
var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
5227+
return $el.length ?
5228+
$el.height() || 0 :
5229+
parseInt(wo.stickyHeaders_offset, 10) || 0;
5230+
}
5231+
52125232
// Sticky headers based on this awesome article:
52135233
// http://css-tricks.com/13465-persistent-headers/
52145234
// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
@@ -5245,8 +5265,7 @@
52455265
$thead = $table.children('thead:first'),
52465266
$header = $thead.children('tr').not('.sticky-false').children(),
52475267
$tfoot = $table.children('tfoot'),
5248-
$stickyOffset = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : '',
5249-
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0,
5268+
stickyOffset = getStickyOffset(c, wo),
52505269
// is this table nested? If so, find parent sticky header wrapper (div, not table)
52515270
$nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
52525271
$table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
@@ -5268,7 +5287,6 @@
52685287
$stickyThead = $stickyTable.children('thead:first'),
52695288
$stickyCells,
52705289
laststate = '',
5271-
spacing = 0,
52725290
setWidth = function($orig, $clone){
52735291
var index, width, border, $cell, $this,
52745292
$cells = $orig.filter(':visible'),
@@ -5300,11 +5318,9 @@
53005318
}
53015319
},
53025320
resizeHeader = function() {
5303-
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0;
5304-
spacing = 0;
53055321
$stickyWrap.css({
53065322
left : $attach.length ? parseInt($attach.css('padding-left'), 10) || 0 :
5307-
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing,
5323+
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft(),
53085324
width: $table.outerWidth()
53095325
});
53105326
setWidth( $table, $stickyTable );
@@ -5315,6 +5331,7 @@
53155331
// Detect nested tables - fixes #724
53165332
nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
53175333
var offset = $table.offset(),
5334+
stickyOffset = getStickyOffset(c, wo),
53185335
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
53195336
xWindow = $.isWindow( $xScroll[0] ),
53205337
attachTop = $attach.length ?
@@ -5330,11 +5347,9 @@
53305347
}
53315348
if (xWindow) {
53325349
// adjust when scrolling horizontally - fixes issue #143
5333-
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing;
5334-
}
5335-
if ($nestedSticky.length) {
5336-
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
5350+
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft();
53375351
}
5352+
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
53385353
$stickyWrap
53395354
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
53405355
.addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide )
@@ -5434,6 +5449,8 @@
54345449
});
54355450
}
54365451

5452+
// make sure sticky is visible if page is partially scrolled
5453+
scrollSticky( true );
54375454
$table.triggerHandler('stickyHeadersInit');
54385455

54395456
},

vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js

+29-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! TableSorter (FORK) v2.28.12 *//*
1+
/*! TableSorter (FORK) v2.28.13 *//*
22
* Client-side table sorting with ease!
33
* @requires jQuery v1.2.6+
44
*
@@ -22,7 +22,7 @@
2222
'use strict';
2323
var ts = $.tablesorter = {
2424

25-
version : '2.28.12',
25+
version : '2.28.13',
2626

2727
parsers : [],
2828
widgets : [],
@@ -98,6 +98,7 @@
9898
cssIconNone : '', // class name added to the icon when there is no column sort
9999
cssIconAsc : '', // class name added to the icon when the column has an ascending sort
100100
cssIconDesc : '', // class name added to the icon when the column has a descending sort
101+
cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
101102

102103
// *** events
103104
pointerClick : 'click',
@@ -1074,28 +1075,40 @@
10741075
▀████▀ ██ █████▀ ██ ██ ██ ██████
10751076
*/
10761077
setHeadersCss : function( c ) {
1077-
var $sorted, indx, column,
1078+
var indx, column,
10781079
list = c.sortList,
10791080
len = list.length,
10801081
none = ts.css.sortNone + ' ' + c.cssNone,
10811082
css = [ ts.css.sortAsc + ' ' + c.cssAsc, ts.css.sortDesc + ' ' + c.cssDesc ],
10821083
cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
10831084
aria = [ 'ascending', 'descending' ],
10841085
// find the footer
1085-
$headers = c.$table
1086+
$extras = c.$table
10861087
.find( 'tfoot tr' )
10871088
.children( 'td, th' )
10881089
.add( $( c.namespace + '_extra_headers' ) )
1089-
.removeClass( css.join( ' ' ) );
1090-
// remove all header information
1091-
c.$headers
1092-
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
1093-
.removeClass( css.join( ' ' ) )
1094-
.addClass( none )
1095-
.attr( 'aria-sort', 'none' )
1090+
.removeClass( css.join( ' ' ) ),
1091+
// remove all header information
1092+
$sorted = c.$headers
1093+
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
1094+
.removeClass( css.join( ' ' ) )
1095+
.addClass( none )
1096+
.attr( 'aria-sort', 'none' )
1097+
.find( '.' + ts.css.icon )
1098+
.removeClass( cssIcon.join( ' ' ) )
1099+
.end();
1100+
// add css none to all sortable headers
1101+
$sorted
1102+
.not( '.sorter-false' )
10961103
.find( '.' + ts.css.icon )
1097-
.removeClass( cssIcon.join( ' ' ) )
10981104
.addClass( cssIcon[ 2 ] );
1105+
// add disabled css icon class
1106+
if ( c.cssIconDisabled ) {
1107+
$sorted
1108+
.filter( '.sorter-false' )
1109+
.find( '.' + ts.css.icon )
1110+
.addClass( c.cssIconDisabled );
1111+
}
10991112
for ( indx = 0; indx < len; indx++ ) {
11001113
// direction = 2 means reset!
11011114
if ( list[ indx ][ 1 ] !== 2 ) {
@@ -1132,8 +1145,8 @@
11321145
}
11331146
}
11341147
// add sorted class to footer & extra headers, if they exist
1135-
if ( $headers.length ) {
1136-
$headers
1148+
if ( $extras.length ) {
1149+
$extras
11371150
.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' )
11381151
.removeClass( none )
11391152
.addClass( css[ list[ indx ][ 1 ] ] );
@@ -1806,10 +1819,10 @@
18061819
},
18071820

18081821
// Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
1809-
// this function will only accept strings, or you'll see 'TypeError: undefined is not a function'
1810-
// I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall
18111822
sortNatural : function( a, b ) {
18121823
if ( a === b ) { return 0; }
1824+
a = a.toString();
1825+
b = b.toString();
18131826
var aNum, bNum, aFloat, bFloat, indx, max,
18141827
regex = ts.regex;
18151828
// first try and sort Hex codes

0 commit comments

Comments
 (0)