Skip to content

Commit 1b8437e

Browse files
committedMay 25, 2017
Update tablesorter to latest version (2.28.11)
1 parent d59b7f4 commit 1b8437e

12 files changed

+81
-58
lines changed
 

‎CHANGELOG.md

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

4+
#### v1.23.11 (2017-05-25)
5+
6+
* Upgrade tablesorter to v2.28.11
7+
48
#### v1.23.10 (2017-05-17)
59

610
* Upgrade tablesorter to v2.28.10

‎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.10 (5/16/2017), [documentation]
7+
Current tablesorter version: 2.28.11 (5/24/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 = 10
4+
TINY = 11
55

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

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

+18-15
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
55
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
66
*/
7-
/*! tablesorter (FORK) - updated 05-16-2017 (v2.28.10)*/
7+
/*! tablesorter (FORK) - updated 05-24-2017 (v2.28.11)*/
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.10 *//*
19+
/*! TableSorter (FORK) v2.28.11 *//*
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.10',
43+
version : '2.28.11',
4444

4545
parsers : [],
4646
widgets : [],
@@ -3149,14 +3149,14 @@
31493149

31503150
})(jQuery);
31513151

3152-
/*! Widget: columns */
3152+
/*! Widget: columns - updated 5/24/2017 (v2.28.11) */
31533153
;(function ($) {
31543154
'use strict';
31553155
var ts = $.tablesorter || {};
31563156

31573157
ts.addWidget({
31583158
id: 'columns',
3159-
priority: 30,
3159+
priority: 65,
31603160
options : {
31613161
columns : [ 'primary', 'secondary', 'tertiary' ]
31623162
},
@@ -3228,7 +3228,7 @@
32283228

32293229
})(jQuery);
32303230

3231-
/*! Widget: filter - updated 4/18/2017 (v2.28.8) *//*
3231+
/*! Widget: filter - updated 5/24/2017 (v2.28.11) *//*
32323232
* Requires tablesorter v2.8+ and jQuery 1.7+
32333233
* by Rob Garrison
32343234
*/
@@ -4046,9 +4046,6 @@
40464046
if ( event.which === tskeyCodes.escape ) {
40474047
// make sure to restore the last value on escape
40484048
this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
4049-
// live search
4050-
} else if ( liveSearch === false ) {
4051-
return;
40524049
// don't return if the search value is empty ( all rows need to be revealed )
40534050
} else if ( this.value !== '' && (
40544051
// liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
@@ -4057,26 +4054,32 @@
40574054
( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
40584055
( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
40594056
return;
4057+
// live search
4058+
} else if ( liveSearch === false ) {
4059+
if ( this.value !== '' && event.which !== tskeyCodes.enter ) {
4060+
return;
4061+
}
40604062
}
40614063
// change event = no delay; last true flag tells getFilters to skip newest timed input
40624064
tsf.searching( table, true, true, column );
40634065
})
40644066
// include change for select - fixes #473
4065-
.bind( 'search change keypress input '.split( ' ' ).join( namespace + ' ' ), function( event ) {
4067+
.bind( 'search change keypress input blur '.split( ' ' ).join( namespace + ' ' ), function( event ) {
40664068
// don't get cached data, in case data-column changes dynamically
40674069
var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
4070+
eventType = event.type,
40684071
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
40694072
wo.filter_liveSearch :
40704073
ts.getColumnData( table, wo.filter_liveSearch, column );
40714074
if ( table.config.widgetOptions.filter_initialized &&
40724075
// immediate search if user presses enter
40734076
( event.which === tskeyCodes.enter ||
4074-
// immediate search if a "search" is triggered on the input
4075-
event.type === 'search' ||
4077+
// immediate search if a "search" or "blur" is triggered on the input
4078+
( eventType === 'search' || eventType === 'blur' ) ||
40764079
// change & input events must be ignored if liveSearch !== true
4077-
( event.type === 'change' || event.type === 'input' ) &&
4080+
( eventType === 'change' || eventType === 'input' ) &&
40784081
// prevent search if liveSearch is a number
4079-
liveSearch === true &&
4082+
( liveSearch === true || liveSearch !== true && event.target.nodeName !== "INPUT" ) &&
40804083
// don't allow 'change' or 'input' event to process if the input value
40814084
// is the same - fixes #685
40824085
this.value !== c.lastSearch[column]
@@ -4085,7 +4088,7 @@
40854088
event.preventDefault();
40864089
// init search with no delay
40874090
$( this ).attr( 'data-lastSearchTime', new Date().getTime() );
4088-
tsf.searching( table, event.type !== 'keypress', true, column );
4091+
tsf.searching( table, eventType !== 'keypress', true, column );
40894092
}
40904093
});
40914094
},

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! TableSorter (FORK) v2.28.10 *//*
1+
/*! TableSorter (FORK) v2.28.11 *//*
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.10',
25+
version : '2.28.11',
2626

2727
parsers : [],
2828
widgets : [],

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

+16-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
55
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
66
*/
7-
/*! tablesorter (FORK) - updated 05-16-2017 (v2.28.10)*/
7+
/*! tablesorter (FORK) - updated 05-24-2017 (v2.28.11)*/
88
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
99
(function(factory) {
1010
if (typeof define === 'function' && define.amd) {
@@ -329,14 +329,14 @@
329329

330330
})(jQuery);
331331

332-
/*! Widget: columns */
332+
/*! Widget: columns - updated 5/24/2017 (v2.28.11) */
333333
;(function ($) {
334334
'use strict';
335335
var ts = $.tablesorter || {};
336336

337337
ts.addWidget({
338338
id: 'columns',
339-
priority: 30,
339+
priority: 65,
340340
options : {
341341
columns : [ 'primary', 'secondary', 'tertiary' ]
342342
},
@@ -408,7 +408,7 @@
408408

409409
})(jQuery);
410410

411-
/*! Widget: filter - updated 4/18/2017 (v2.28.8) *//*
411+
/*! Widget: filter - updated 5/24/2017 (v2.28.11) *//*
412412
* Requires tablesorter v2.8+ and jQuery 1.7+
413413
* by Rob Garrison
414414
*/
@@ -1226,9 +1226,6 @@
12261226
if ( event.which === tskeyCodes.escape ) {
12271227
// make sure to restore the last value on escape
12281228
this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
1229-
// live search
1230-
} else if ( liveSearch === false ) {
1231-
return;
12321229
// don't return if the search value is empty ( all rows need to be revealed )
12331230
} else if ( this.value !== '' && (
12341231
// liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
@@ -1237,26 +1234,32 @@
12371234
( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
12381235
( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
12391236
return;
1237+
// live search
1238+
} else if ( liveSearch === false ) {
1239+
if ( this.value !== '' && event.which !== tskeyCodes.enter ) {
1240+
return;
1241+
}
12401242
}
12411243
// change event = no delay; last true flag tells getFilters to skip newest timed input
12421244
tsf.searching( table, true, true, column );
12431245
})
12441246
// include change for select - fixes #473
1245-
.bind( 'search change keypress input '.split( ' ' ).join( namespace + ' ' ), function( event ) {
1247+
.bind( 'search change keypress input blur '.split( ' ' ).join( namespace + ' ' ), function( event ) {
12461248
// don't get cached data, in case data-column changes dynamically
12471249
var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
1250+
eventType = event.type,
12481251
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
12491252
wo.filter_liveSearch :
12501253
ts.getColumnData( table, wo.filter_liveSearch, column );
12511254
if ( table.config.widgetOptions.filter_initialized &&
12521255
// immediate search if user presses enter
12531256
( event.which === tskeyCodes.enter ||
1254-
// immediate search if a "search" is triggered on the input
1255-
event.type === 'search' ||
1257+
// immediate search if a "search" or "blur" is triggered on the input
1258+
( eventType === 'search' || eventType === 'blur' ) ||
12561259
// change & input events must be ignored if liveSearch !== true
1257-
( event.type === 'change' || event.type === 'input' ) &&
1260+
( eventType === 'change' || eventType === 'input' ) &&
12581261
// prevent search if liveSearch is a number
1259-
liveSearch === true &&
1262+
( liveSearch === true || liveSearch !== true && event.target.nodeName !== "INPUT" ) &&
12601263
// don't allow 'change' or 'input' event to process if the input value
12611264
// is the same - fixes #685
12621265
this.value !== c.lastSearch[column]
@@ -1265,7 +1268,7 @@
12651268
event.preventDefault();
12661269
// init search with no delay
12671270
$( this ).attr( 'data-lastSearchTime', new Date().getTime() );
1268-
tsf.searching( table, event.type !== 'keypress', true, column );
1271+
tsf.searching( table, eventType !== 'keypress', true, column );
12691272
}
12701273
});
12711274
},

‎vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/*! Parser: dates - updated 8/22/2016 (v2.27.5) */
1+
/*! Parser: dates - updated 5/24/2017 (v2.28.11) */
22
/* Extract dates using popular natural language date parsers */
33
/*jshint jquery:true */
44
/*global Sugar*/
55
;(function($){
66
'use strict';
77

88
/*! Sugar (https://sugarjs.com/docs/#/DateParsing) */
9-
/* demo: http://jsfiddle.net/Mottie/abkNM/4163/ */
9+
/* demo: http://jsfiddle.net/Mottie/7z0ss5xn/ */
1010
$.tablesorter.addParser({
1111
id: 'sugar',
1212
is: function() {
@@ -22,7 +22,7 @@
2222
});
2323

2424
/*! Datejs (http://www.datejs.com/) */
25-
/* demo: http://jsfiddle.net/Mottie/abkNM/4164/ */
25+
/* demo: http://jsfiddle.net/Mottie/zge0L2u6/ */
2626
$.tablesorter.addParser({
2727
id: 'datejs',
2828
is: function() {

‎vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columns.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
/*! Widget: columns */
1+
/*! Widget: columns - updated 5/24/2017 (v2.28.11) */
22
;(function ($) {
33
'use strict';
44
var ts = $.tablesorter || {};
55

66
ts.addWidget({
77
id: 'columns',
8-
priority: 30,
8+
priority: 65,
99
options : {
1010
columns : [ 'primary', 'secondary', 'tertiary' ]
1111
},

‎vendor/assets/javascripts/jquery-tablesorter/widgets/widget-cssStickyHeaders.js

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Widget: cssStickyHeaders - updated 2/9/2015 (v2.19.1) *//*
1+
/*! Widget: cssStickyHeaders - updated 5/24/2017 (v2.28.11) *//*
22
* Requires a modern browser, tablesorter v2.8+
33
*/
44
/*jshint jquery:true, unused:false */
@@ -18,17 +18,20 @@
1818
cssStickyHeaders_filteredToTop : true
1919
},
2020
init : function(table, thisWidget, c, wo) {
21-
var ht, offst, adjustY,
21+
var offst, adjustY,
2222
$table = c.$table,
2323
$attach = $(wo.cssStickyHeaders_attachTo),
24-
isIE = 'ActiveXObject' in window, // target all versions of IE
24+
// target all versions of IE
25+
isIE = 'ActiveXObject' in window || window.navigator.userAgent.indexOf("Edge") > -1,
2526
namespace = c.namespace + 'cssstickyheader ',
2627
$thead = $table.children('thead'),
2728
$caption = $table.children('caption'),
2829
$win = $attach.length ? $attach : $(window),
2930
$parent = $table.parent().closest('table.' + ts.css.table),
3031
$parentThead = $parent.length && ts.hasWidget($parent[0], 'cssStickyHeaders') ? $parent.children('thead') : [],
3132
borderTopWidth = ( parseInt( $table.css('border-top-width'), 10 ) || 0 ),
33+
// Fixes for Safari
34+
tableH = $table.height(),
3235
lastCaptionSetting = wo.cssStickyHeaders_addCaption,
3336
// table offset top changes while scrolling in FF
3437
adjustOffsetTop = false,
@@ -46,9 +49,8 @@
4649
if ($caption.length) {
4750
// Firefox does not include the caption height when getting the table height
4851
// see https://bugzilla.mozilla.org/show_bug.cgi?id=820891, so lets detect it instead of browser sniff
49-
ht = $table.height();
5052
$caption.hide();
51-
addCaptionHeight = $table.height() === ht;
53+
addCaptionHeight = $table.height() === tableH;
5254
$caption.show();
5355

5456
// Firefox changes the offset().top when translating the table caption
@@ -71,14 +73,20 @@
7173
adjustY = $table.offset().top;
7274
}
7375

76+
// Fix for safari, when caption present, table
77+
// height changes while scrolling
78+
if ($win.scrollTop() < $caption.outerHeight(true)) {
79+
tableH = $table.height();
80+
}
81+
7482
var top = $attach.length ? $attach.offset().top : $win.scrollTop(),
7583
// add caption height; include table padding top & border-spacing or text may be above the fold (jQuery UI themes)
7684
// border-spacing needed in Firefox, but not webkit... not sure if I should account for that
7785
captionHeight = ( $caption.outerHeight(true) || 0 ) +
7886
( parseInt( $table.css('padding-top'), 10 ) || 0 ) +
7987
( parseInt( $table.css('border-spacing'), 10 ) || 0 ),
8088

81-
bottom = $table.height() + ( addCaptionHeight && wo.cssStickyHeaders_addCaption ? captionHeight : 0 ) -
89+
bottom = tableH + ( addCaptionHeight && wo.cssStickyHeaders_addCaption ? captionHeight : 0 ) -
8290
$thead.height() - ( $table.children('tfoot').height() || 0 ) -
8391
( wo.cssStickyHeaders_addCaption ? captionHeight : ( addCaptionHeight ? 0 : captionHeight ) ),
8492

0 commit comments

Comments
 (0)
Please sign in to comment.