mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Check that the filter is not undefined before encoding/decoding it.
If we include undefined filter values in the encoding/decoding, then we store 'undefined' as the value in the cookie. When this gets parsed out, it's treated as an actual value. This will likely not match anything resulting in the initial filtering to filter out all results.
This commit is contained in:
parent
f469d399f7
commit
4cb15889d7
6
dist/js/jquery.tablesorter.combined.js
vendored
6
dist/js/jquery.tablesorter.combined.js
vendored
@ -1,4 +1,4 @@
|
||||
/*! tablesorter (FORK) - updated 01-15-2016 (v2.25.2)*/
|
||||
/*! tablesorter (FORK) - updated 01-19-2016 (v2.25.2)*/
|
||||
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
@ -3701,7 +3701,9 @@
|
||||
mode = encode ? encodeURIComponent : decodeURIComponent,
|
||||
len = filters.length;
|
||||
for ( indx = 0; indx < len; indx++ ) {
|
||||
filters[ indx ] = mode( filters[ indx ] );
|
||||
if ( typeof filters[ indx ] !== 'undefined' ) {
|
||||
filters[ indx ] = mode( filters[ indx ] );
|
||||
}
|
||||
}
|
||||
return filters;
|
||||
},
|
||||
|
6
dist/js/jquery.tablesorter.combined.min.js
vendored
6
dist/js/jquery.tablesorter.combined.min.js
vendored
File diff suppressed because one or more lines are too long
6
dist/js/jquery.tablesorter.widgets.js
vendored
6
dist/js/jquery.tablesorter.widgets.js
vendored
@ -1,4 +1,4 @@
|
||||
/*! tablesorter (FORK) - updated 01-15-2016 (v2.25.2)*/
|
||||
/*! tablesorter (FORK) - updated 01-19-2016 (v2.25.2)*/
|
||||
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
@ -983,7 +983,9 @@
|
||||
mode = encode ? encodeURIComponent : decodeURIComponent,
|
||||
len = filters.length;
|
||||
for ( indx = 0; indx < len; indx++ ) {
|
||||
filters[ indx ] = mode( filters[ indx ] );
|
||||
if ( typeof filters[ indx ] !== 'undefined' ) {
|
||||
filters[ indx ] = mode( filters[ indx ] );
|
||||
}
|
||||
}
|
||||
return filters;
|
||||
},
|
||||
|
6
dist/js/jquery.tablesorter.widgets.min.js
vendored
6
dist/js/jquery.tablesorter.widgets.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/widgets/widget-filter.min.js
vendored
2
dist/js/widgets/widget-filter.min.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
||||
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
||||
*/
|
||||
/*! tablesorter (FORK) - updated 01-15-2016 (v2.25.2)*/
|
||||
/*! tablesorter (FORK) - updated 01-19-2016 (v2.25.2)*/
|
||||
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
@ -3707,7 +3707,9 @@
|
||||
mode = encode ? encodeURIComponent : decodeURIComponent,
|
||||
len = filters.length;
|
||||
for ( indx = 0; indx < len; indx++ ) {
|
||||
filters[ indx ] = mode( filters[ indx ] );
|
||||
if ( typeof filters[ indx ] !== 'undefined' ) {
|
||||
filters[ indx ] = mode( filters[ indx ] );
|
||||
}
|
||||
}
|
||||
return filters;
|
||||
},
|
||||
|
@ -4,7 +4,7 @@
|
||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
||||
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
||||
*/
|
||||
/*! tablesorter (FORK) - updated 01-15-2016 (v2.25.2)*/
|
||||
/*! tablesorter (FORK) - updated 01-19-2016 (v2.25.2)*/
|
||||
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
@ -989,7 +989,9 @@
|
||||
mode = encode ? encodeURIComponent : decodeURIComponent,
|
||||
len = filters.length;
|
||||
for ( indx = 0; indx < len; indx++ ) {
|
||||
filters[ indx ] = mode( filters[ indx ] );
|
||||
if ( typeof filters[ indx ] !== 'undefined' ) {
|
||||
filters[ indx ] = mode( filters[ indx ] );
|
||||
}
|
||||
}
|
||||
return filters;
|
||||
},
|
||||
|
@ -615,7 +615,9 @@
|
||||
mode = encode ? encodeURIComponent : decodeURIComponent,
|
||||
len = filters.length;
|
||||
for ( indx = 0; indx < len; indx++ ) {
|
||||
filters[ indx ] = mode( filters[ indx ] );
|
||||
if ( typeof filters[ indx ] !== 'undefined' ) {
|
||||
filters[ indx ] = mode( filters[ indx ] );
|
||||
}
|
||||
}
|
||||
return filters;
|
||||
},
|
||||
|
@ -158,6 +158,18 @@ jQuery(function($){
|
||||
assert.deepEqual( range( c, 'a-b-c,100' ), [ 0,1,2,3,4,5,6,7,8,9 ], 'text with dashes & commas -> all columns' );
|
||||
});
|
||||
|
||||
QUnit.test( 'Filter process filters', function(assert) {
|
||||
expect(2);
|
||||
var processFilters = this.ts.filter.processFilters,
|
||||
filters = [],
|
||||
results = [];
|
||||
filters[1] = 5, filters[2] = 'test', filters[3] = true;
|
||||
results[1] = '5', results[2] = 'test', results[3] = 'true';
|
||||
|
||||
assert.deepEqual( processFilters( filters, true ), results );
|
||||
assert.deepEqual( processFilters( filters, false ), results );
|
||||
});
|
||||
|
||||
QUnit.test( 'Filter searches', function(assert) {
|
||||
var ts = this.ts,
|
||||
c = this.c,
|
||||
|
Loading…
Reference in New Issue
Block a user