Skip to content

Commit 6f01d0f

Browse files
committed
Update tablesorter to latest version (2.28.15)
1 parent 541fe73 commit 6f01d0f

File tree

9 files changed

+105
-19
lines changed

9 files changed

+105
-19
lines changed

CHANGELOG.md

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

4+
#### v1.23.14 (2017-07-09)
5+
6+
* Upgrade tablesorter to v2.28.15
7+
48
#### v1.23.13 (2017-06-06)
59

610
* Upgrade tablesorter to v2.28.13

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.13 (6/2/2017) [documentation]
7+
Current tablesorter version: 2.28.15 (7/4/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 = 13
4+
TINY = 14
55

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

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

+15-5
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,22 @@
321321
},
322322

323323
fixHeight = function(table, p) {
324-
var d, h,
324+
var d, h, bs,
325325
c = table.config,
326326
$b = c.$tbodies.eq(0);
327327
$b.find('tr.pagerSavedHeightSpacer').remove();
328328
if (p.fixedHeight && !p.isDisabled) {
329329
h = $.data(table, 'pagerSavedHeight');
330330
if (h) {
331-
d = h - $b.height();
332-
if ( d > 5 && $.data(table, 'pagerLastSize') === p.size &&
333-
$b.children('tr:visible').length < (p.size === 'all' ? p.totalRows : p.size) ) {
331+
bs = 0;
332+
if ($(table).css('border-spacing').split(' ').length > 1) {
333+
bs = $(table).css('border-spacing').split(' ')[1].replace(/[^-\d\.]/g, '');
334+
}
335+
d = h - $b.height() + (bs * p.size) - bs;
336+
if (
337+
d > 5 && $.data(table, 'pagerLastSize') === p.size &&
338+
$b.children('tr:visible').length < (p.size === 'all' ? p.totalRows : p.size)
339+
) {
334340
$b.append('<tr class="pagerSavedHeightSpacer ' + c.selectorRemove.slice(1) + '" style="height:' + d + 'px;"></tr>');
335341
}
336342
}
@@ -969,6 +975,10 @@
969975
.bind('filterInit filterStart '.split(' ').join(namespace + ' '), function(e, filters) {
970976
p.currentFilters = $.isArray(filters) ? filters : c.$table.data('lastSearch');
971977
var filtersEqual;
978+
if (p.ajax && e.type === 'filterInit') {
979+
// ensure pager ajax is called after filter widget has initialized
980+
return moveToPage( table, p, false );
981+
}
972982
if (ts.filter.equalFilters) {
973983
filtersEqual = ts.filter.equalFilters(c, c.lastSearch, p.currentFilters);
974984
} else {
@@ -1188,7 +1198,7 @@
11881198
valid = true,
11891199
message = '',
11901200
removeRow = function(){
1191-
c.$table.find( 'thead' ).find( '.' + errorRow ).remove();
1201+
c.$table.find( 'thead' ).find( c.selectorRemove ).remove();
11921202
};
11931203

11941204
if ( !$table.length ) {

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

+36-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
55
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
66
*/
7-
/*! tablesorter (FORK) - updated 06-02-2017 (v2.28.13)*/
7+
/*! tablesorter (FORK) - updated 06-08-2017 (v2.28.14)*/
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.13 *//*
19+
/*! TableSorter (FORK) v2.28.14 *//*
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.13',
43+
version : '2.28.14',
4444

4545
parsers : [],
4646
widgets : [],
@@ -2293,9 +2293,42 @@
22932293
}
22942294
}
22952295
}
2296+
ts.checkColumnCount($rows, matrix, matrixrow.length);
22962297
return matrixrow.length;
22972298
},
22982299

2300+
checkColumnCount : function($rows, matrix, columns) {
2301+
// this DOES NOT report any tbody column issues, except for the math and
2302+
// and column selector widgets
2303+
var i, len,
2304+
valid = true,
2305+
cells = [];
2306+
for ( i = 0; i < matrix.length; i++ ) {
2307+
// some matrix entries are undefined when testing the footer because
2308+
// it is using the rowIndex property
2309+
if ( matrix[i] ) {
2310+
len = matrix[i].length;
2311+
if ( matrix[i].length !== columns ) {
2312+
valid = false;
2313+
break;
2314+
}
2315+
}
2316+
}
2317+
if ( !valid ) {
2318+
$rows.each( function( indx, el ) {
2319+
var cell = el.parentElement.nodeName;
2320+
if ( cells.indexOf( cell ) ) {
2321+
cells.push( cell );
2322+
}
2323+
});
2324+
console.error(
2325+
'Invalid or incorrect number of columns in the ' +
2326+
cells.join( ' or ' ) + '; expected ' + columns +
2327+
', but found ' + len + ' columns'
2328+
);
2329+
}
2330+
},
2331+
22992332
// automatically add a colgroup with col elements set to a percentage width
23002333
fixColumnWidth : function( table ) {
23012334
table = $( table )[ 0 ];

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

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! TableSorter (FORK) v2.28.13 *//*
1+
/*! TableSorter (FORK) v2.28.14 *//*
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.13',
25+
version : '2.28.14',
2626

2727
parsers : [],
2828
widgets : [],
@@ -2275,9 +2275,42 @@
22752275
}
22762276
}
22772277
}
2278+
ts.checkColumnCount($rows, matrix, matrixrow.length);
22782279
return matrixrow.length;
22792280
},
22802281

2282+
checkColumnCount : function($rows, matrix, columns) {
2283+
// this DOES NOT report any tbody column issues, except for the math and
2284+
// and column selector widgets
2285+
var i, len,
2286+
valid = true,
2287+
cells = [];
2288+
for ( i = 0; i < matrix.length; i++ ) {
2289+
// some matrix entries are undefined when testing the footer because
2290+
// it is using the rowIndex property
2291+
if ( matrix[i] ) {
2292+
len = matrix[i].length;
2293+
if ( matrix[i].length !== columns ) {
2294+
valid = false;
2295+
break;
2296+
}
2297+
}
2298+
}
2299+
if ( !valid ) {
2300+
$rows.each( function( indx, el ) {
2301+
var cell = el.parentElement.nodeName;
2302+
if ( cells.indexOf( cell ) ) {
2303+
cells.push( cell );
2304+
}
2305+
});
2306+
console.error(
2307+
'Invalid or incorrect number of columns in the ' +
2308+
cells.join( ' or ' ) + '; expected ' + columns +
2309+
', but found ' + len + ' columns'
2310+
);
2311+
}
2312+
},
2313+
22812314
// automatically add a colgroup with col elements set to a percentage width
22822315
fixColumnWidth : function( table ) {
22832316
table = $( table )[ 0 ];

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
55
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
66
*/
7-
/*! tablesorter (FORK) - updated 06-02-2017 (v2.28.13)*/
7+
/*! tablesorter (FORK) - updated 06-08-2017 (v2.28.14)*/
88
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
99
(function(factory) {
1010
if (typeof define === 'function' && define.amd) {

vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@
611611
},
612612

613613
fixHeight: function( c ) {
614-
var d, h,
614+
var d, h, bs,
615615
table = c.table,
616616
p = c.pager,
617617
wo = c.widgetOptions,
@@ -620,9 +620,15 @@
620620
if ( wo.pager_fixedHeight && !p.isDisabled ) {
621621
h = $.data( table, 'pagerSavedHeight' );
622622
if ( h ) {
623-
d = h - $b.height();
624-
if ( d > 5 && $.data( table, 'pagerLastSize' ) === p.size &&
625-
$b.children( 'tr:visible' ).length < ( p.size === 'all' ? p.totalRows : p.size ) ) {
623+
bs = 0;
624+
if ( $(table).css('border-spacing').split(' ').length > 1 ) {
625+
bs = $(table).css('border-spacing').split(' ')[1].replace( /[^-\d\.]/g, '' );
626+
}
627+
d = h - $b.height() + (bs * p.size) - bs;
628+
if (
629+
d > 5 && $.data( table, 'pagerLastSize' ) === p.size &&
630+
$b.children( 'tr:visible' ).length < ( p.size === 'all' ? p.totalRows : p.size )
631+
) {
626632
$b.append( '<tr class="pagerSavedHeightSpacer ' + c.selectorRemove.slice( 1 ) +
627633
'" style="height:' + d + 'px;"></tr>' );
628634
}
@@ -1301,7 +1307,7 @@
13011307
valid = true,
13021308
message = '',
13031309
removeRow = function() {
1304-
c.$table.find( 'thead' ).find( '.' + errorRow ).remove();
1310+
c.$table.find( 'thead' ).find( c.selectorRemove ).remove();
13051311
};
13061312

13071313
if ( !$table.length ) {

0 commit comments

Comments
 (0)