Skip to content

Commit 736e68b

Browse files
committedApr 23, 2017
Update tablesorter to latest version (2.28.8)
1 parent 53f077d commit 736e68b

13 files changed

+235
-122
lines changed
 

‎CHANGELOG.md

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

4+
#### v1.23.8 (2017-04-23)
5+
6+
* Upgrade tablesorter to v2.28.8
7+
* Readme: Updated ruby version
8+
49
#### v1.23.7 (2017-04-09)
510

611
* Upgrade tablesorter to v2.28.7

‎README.md

+2-2
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.7 (4/4/2017), [documentation]
7+
Current tablesorter version: 2.28.8 (4/18/2017), [documentation]
88

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

@@ -24,7 +24,7 @@ Or install it yourself as:
2424

2525
## Requirements
2626

27-
It should work with Rails 3.2 and higher (tested up to 5) as well as with ruby 1.9.3 - 2.3.x.
27+
It should work with Rails 3.2 and higher (tested up to 5) as well as with ruby 1.9.3 - 2.4.x.
2828
Each release is always tested with the latest version of both.
2929

3030
## Usage

‎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 = 7
4+
TINY = 8
55

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

‎tablesorter

Submodule tablesorter updated 46 files

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

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* tablesorter (FORK) pager plugin
3-
* updated 4/2/2017 (v2.28.6)
3+
* updated 4/18/2017 (v2.28.8)
44
*/
55
/*jshint browser:true, jquery:true, unused:false */
66
;(function($) {
@@ -968,11 +968,15 @@
968968
.unbind( pagerEvents.split(' ').join(namespace + ' ').replace(/\s+/g, ' ') )
969969
.bind('filterInit filterStart '.split(' ').join(namespace + ' '), function(e, filters) {
970970
p.currentFilters = $.isArray(filters) ? filters : c.$table.data('lastSearch');
971+
var filtersEqual;
972+
if (ts.filter.equalFilters) {
973+
filtersEqual = ts.filter.equalFilters(c, c.lastSearch, p.currentFilters);
974+
} else {
975+
// will miss filter changes of the same value in a different column, see #1363
976+
filtersEqual = (c.lastSearch || []).join('') !== (p.currentFilters || []).join('');
977+
}
971978
// don't change page if filters are the same (pager updating, etc)
972-
if (
973-
e.type === 'filterStart' &&
974-
p.pageReset !== false &&
975-
(c.lastSearch || []).join(',') !== (p.currentFilters || []).join(',')) {
979+
if (e.type === 'filterStart' && p.pageReset !== false && !filtersEqual) {
976980
p.page = p.pageReset; // fixes #456 & #565
977981
}
978982
})

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

+67-35
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
55
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
66
*/
7-
/*! tablesorter (FORK) - updated 04-04-2017 (v2.28.7)*/
7+
/*! tablesorter (FORK) - updated 04-18-2017 (v2.28.8)*/
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.7 *//*
19+
/*! TableSorter (FORK) v2.28.8 *//*
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.7',
43+
version : '2.28.8',
4444

4545
parsers : [],
4646
widgets : [],
@@ -1325,7 +1325,7 @@
13251325
cell = $cell[ 0 ]; // in case cell is a jQuery object
13261326
// tbody may not exist if update is initialized while tbody is removed for processing
13271327
if ( $tbodies.length && tbodyIndex >= 0 ) {
1328-
row = $tbodies.eq( tbodyIndex ).find( 'tr' ).index( $row );
1328+
row = $tbodies.eq( tbodyIndex ).find( 'tr' ).not( '.' + c.cssChildRow ).index( $row );
13291329
cache = tbcache.normalized[ row ];
13301330
len = $row[ 0 ].cells.length;
13311331
if ( len !== c.columns ) {
@@ -1346,7 +1346,6 @@
13461346
cache[ c.columns ].raw[ icell ] = tmp;
13471347
tmp = ts.getParsedText( c, cell, icell, tmp );
13481348
cache[ icell ] = tmp; // parsed
1349-
cache[ c.columns ].$row = $row;
13501349
if ( ( c.parsers[ icell ].type || '' ).toLowerCase() === 'numeric' ) {
13511350
// update column max value (ignore sign)
13521351
tbcache.colMax[ icell ] = Math.max( Math.abs( tmp ) || 0, tbcache.colMax[ icell ] || 0 );
@@ -2827,12 +2826,26 @@
28272826

28282827
})( jQuery );
28292828

2830-
/*! Widget: storage - updated 11/26/2016 (v2.28.0) */
2829+
/*! Widget: storage - updated 4/18/2017 (v2.28.8) */
28312830
/*global JSON:false */
28322831
;(function ($, window, document) {
28332832
'use strict';
28342833

28352834
var ts = $.tablesorter || {};
2835+
2836+
// update defaults for validator; these values must be falsy!
2837+
$.extend(true, ts.defaults, {
2838+
fixedUrl: '',
2839+
widgetOptions: {
2840+
storage_fixedUrl: '',
2841+
storage_group: '',
2842+
storage_page: '',
2843+
storage_storageType: '',
2844+
storage_tableId: '',
2845+
storage_useSessionStorage: ''
2846+
}
2847+
});
2848+
28362849
// *** Store data in local storage, with a cookie fallback ***
28372850
/* IE7 needs JSON library for JSON.stringify - (http://caniuse.com/#search=json)
28382851
if you need it, then include https://github.com/douglascrockford/JSON-js
@@ -2859,8 +2872,12 @@
28592872
values = {},
28602873
c = table.config,
28612874
wo = c && c.widgetOptions,
2862-
storageType = ( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ) ?
2863-
'sessionStorage' : 'localStorage',
2875+
storageType = (
2876+
( options && options.storageType ) || ( wo && wo.storage_storageType )
2877+
).toString().charAt(0).toLowerCase(),
2878+
// deprecating "useSessionStorage"; any storageType setting overrides it
2879+
session = storageType ? '' :
2880+
( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ),
28642881
$table = $(table),
28652882
// id from (1) options ID, (2) table 'data-table-group' attribute, (3) widgetOptions.storage_tableId,
28662883
// (4) table ID, then (5) table index
@@ -2872,29 +2889,26 @@
28722889
url = options && options.url ||
28732890
$table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
28742891
wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
2875-
// update defaults for validator; these values must be falsy!
2876-
$.extend(true, ts.defaults, {
2877-
fixedUrl: '',
2878-
widgetOptions: {
2879-
storage_fixedUrl: '',
2880-
storage_group: '',
2881-
storage_page: '',
2882-
storage_tableId: '',
2883-
storage_useSessionStorage: ''
2884-
}
2885-
});
2886-
// https://gist.github.com/paulirish/5558557
2887-
if (storageType in window) {
2888-
try {
2889-
window[storageType].setItem('_tmptest', 'temp');
2890-
hasStorage = true;
2891-
window[storageType].removeItem('_tmptest');
2892-
} catch (error) {
2893-
if (c && c.debug) {
2894-
console.warn( storageType + ' is not supported in this browser' );
2892+
2893+
// skip if using cookies
2894+
if (storageType !== 'c') {
2895+
storageType = (storageType === 's' || session) ? 'sessionStorage' : 'localStorage';
2896+
// https://gist.github.com/paulirish/5558557
2897+
if (storageType in window) {
2898+
try {
2899+
window[storageType].setItem('_tmptest', 'temp');
2900+
hasStorage = true;
2901+
window[storageType].removeItem('_tmptest');
2902+
} catch (error) {
2903+
if (c && c.debug) {
2904+
console.warn( storageType + ' is not supported in this browser' );
2905+
}
28952906
}
28962907
}
28972908
}
2909+
if (c.debug) {
2910+
console.log('Storage widget using', hasStorage ? storageType : 'cookies');
2911+
}
28982912
// *** get value ***
28992913
if ($.parseJSON) {
29002914
if (hasStorage) {
@@ -3204,7 +3218,7 @@
32043218

32053219
})(jQuery);
32063220

3207-
/*! Widget: filter - updated 4/4/2017 (v2.28.7) *//*
3221+
/*! Widget: filter - updated 4/18/2017 (v2.28.8) *//*
32083222
* Requires tablesorter v2.8+ and jQuery 1.7+
32093223
* by Rob Garrison
32103224
*/
@@ -4091,6 +4105,19 @@
40914105
tsf.checkFilters( table, filter, skipFirst );
40924106
}
40934107
},
4108+
equalFilters: function (c, filter1, filter2) {
4109+
var indx,
4110+
f1 = [],
4111+
f2 = [],
4112+
len = c.columns + 1; // add one to include anyMatch filter
4113+
filter1 = $.isArray(filter1) ? filter1 : [];
4114+
filter2 = $.isArray(filter2) ? filter2 : [];
4115+
for (indx = 0; indx < len; indx++) {
4116+
f1[indx] = filter1[indx] || '';
4117+
f2[indx] = filter2[indx] || '';
4118+
}
4119+
return f1.join(',') === f2.join(',');
4120+
},
40944121
checkFilters: function( table, filter, skipFirst ) {
40954122
var c = table.config,
40964123
wo = c.widgetOptions,
@@ -4123,7 +4150,7 @@
41234150
}
41244151
// return if the last search is the same; but filter === false when updating the search
41254152
// see example-widget-filter.html filter toggle buttons
4126-
if ( c.lastSearch.join(',') === currentFilters.join(',') && filter !== false ) {
4153+
if ( tsf.equalFilters(c, c.lastSearch, currentFilters) && filter !== false ) {
41274154
return;
41284155
} else if ( filter === false ) {
41294156
// force filter refresh
@@ -4472,7 +4499,7 @@
44724499
},
44734500
findRows: function( table, filters, currentFilters ) {
44744501
if (
4475-
table.config.lastSearch.join(',') === ( currentFilters || [] ).join(',') ||
4502+
tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
44764503
!table.config.widgetOptions.filter_initialized
44774504
) {
44784505
return;
@@ -5017,7 +5044,8 @@
50175044
if ( ( getRaw !== true && wo && !wo.filter_columnFilters ) ||
50185045
// setFilters called, but last search is exactly the same as the current
50195046
// fixes issue #733 & #903 where calling update causes the input values to reset
5020-
( $.isArray(setFilters) && setFilters.join(',') === c.lastSearch.join(',') ) ) {
5047+
( $.isArray(setFilters) && tsf.equalFilters(c, setFilters, c.lastSearch) )
5048+
) {
50215049
return $( table ).data( 'lastSearch' ) || [];
50225050
}
50235051
if ( c ) {
@@ -5402,7 +5430,7 @@
54025430

54035431
})(jQuery, window);
54045432

5405-
/*! Widget: resizable - updated 1/28/2017 (v2.28.5) */
5433+
/*! Widget: resizable - updated 4/18/2017 (v2.28.8) */
54065434
/*jshint browser:true, jquery:true, unused:false */
54075435
;(function ($, window) {
54085436
'use strict';
@@ -5567,6 +5595,10 @@
55675595
tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
55685596
});
55695597
}
5598+
5599+
if ( !wo.resizable_includeFooter && c.$table.children('tfoot').length ) {
5600+
tableHeight -= c.$table.children('tfoot').height();
5601+
}
55705602
// subtract out table left position from resizable handles. Fixes #864
55715603
startPosition = c.$table.position().left;
55725604
$handles.each( function() {
@@ -5737,10 +5769,10 @@
57375769
options: {
57385770
resizable : true, // save column widths to storage
57395771
resizable_addLastColumn : false,
5772+
resizable_includeFooter: true,
57405773
resizable_widths : [],
57415774
resizable_throttle : false, // set to true (5ms) or any number 0-10 range
5742-
resizable_targetLast : false,
5743-
resizable_fullWidth : null
5775+
resizable_targetLast : false
57445776
},
57455777
init: function(table, thisWidget, c, wo) {
57465778
ts.resizable.init( c, wo );

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! TableSorter (FORK) v2.28.7 *//*
1+
/*! TableSorter (FORK) v2.28.8 *//*
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.7',
25+
version : '2.28.8',
2626

2727
parsers : [],
2828
widgets : [],
@@ -1307,7 +1307,7 @@
13071307
cell = $cell[ 0 ]; // in case cell is a jQuery object
13081308
// tbody may not exist if update is initialized while tbody is removed for processing
13091309
if ( $tbodies.length && tbodyIndex >= 0 ) {
1310-
row = $tbodies.eq( tbodyIndex ).find( 'tr' ).index( $row );
1310+
row = $tbodies.eq( tbodyIndex ).find( 'tr' ).not( '.' + c.cssChildRow ).index( $row );
13111311
cache = tbcache.normalized[ row ];
13121312
len = $row[ 0 ].cells.length;
13131313
if ( len !== c.columns ) {
@@ -1328,7 +1328,6 @@
13281328
cache[ c.columns ].raw[ icell ] = tmp;
13291329
tmp = ts.getParsedText( c, cell, icell, tmp );
13301330
cache[ icell ] = tmp; // parsed
1331-
cache[ c.columns ].$row = $row;
13321331
if ( ( c.parsers[ icell ].type || '' ).toLowerCase() === 'numeric' ) {
13331332
// update column max value (ignore sign)
13341333
tbcache.colMax[ icell ] = Math.max( Math.abs( tmp ) || 0, tbcache.colMax[ icell ] || 0 );

0 commit comments

Comments
 (0)
Please sign in to comment.