Treat null filters the same way as undefined filters.

This commit is contained in:
tschilling 2016-01-20 10:50:35 -05:00
parent 4cb15889d7
commit 426d72b50d
9 changed files with 18 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 01-19-2016 (v2.25.2)*/
/*! tablesorter (FORK) - updated 01-20-2016 (v2.25.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -3701,7 +3701,7 @@
mode = encode ? encodeURIComponent : decodeURIComponent,
len = filters.length;
for ( indx = 0; indx < len; indx++ ) {
if ( typeof filters[ indx ] !== 'undefined' ) {
if ( filters[ indx ] ) {
filters[ indx ] = mode( filters[ indx ] );
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 01-19-2016 (v2.25.2)*/
/*! tablesorter (FORK) - updated 01-20-2016 (v2.25.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -983,7 +983,7 @@
mode = encode ? encodeURIComponent : decodeURIComponent,
len = filters.length;
for ( indx = 0; indx < len; indx++ ) {
if ( typeof filters[ indx ] !== 'undefined' ) {
if ( filters[ indx ] ) {
filters[ indx ] = mode( filters[ indx ] );
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 01-19-2016 (v2.25.2)*/
/*! tablesorter (FORK) - updated 01-20-2016 (v2.25.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -3707,7 +3707,7 @@
mode = encode ? encodeURIComponent : decodeURIComponent,
len = filters.length;
for ( indx = 0; indx < len; indx++ ) {
if ( typeof filters[ indx ] !== 'undefined' ) {
if ( filters[ indx ] ) {
filters[ indx ] = mode( filters[ indx ] );
}
}

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 01-19-2016 (v2.25.2)*/
/*! tablesorter (FORK) - updated 01-20-2016 (v2.25.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -989,7 +989,7 @@
mode = encode ? encodeURIComponent : decodeURIComponent,
len = filters.length;
for ( indx = 0; indx < len; indx++ ) {
if ( typeof filters[ indx ] !== 'undefined' ) {
if ( filters[ indx ] ) {
filters[ indx ] = mode( filters[ indx ] );
}
}

View File

@ -615,7 +615,7 @@
mode = encode ? encodeURIComponent : decodeURIComponent,
len = filters.length;
for ( indx = 0; indx < len; indx++ ) {
if ( typeof filters[ indx ] !== 'undefined' ) {
if ( filters[ indx ] ) {
filters[ indx ] = mode( filters[ indx ] );
}
}

View File

@ -163,8 +163,8 @@ jQuery(function($){
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';
filters[1] = 5, filters[2] = 'test', filters[3] = true, filters[4] = null;
results[1] = '5', results[2] = 'test', results[3] = 'true', results[4] = null;
assert.deepEqual( processFilters( filters, true ), results );
assert.deepEqual( processFilters( filters, false ), results );