Filter: use namespacing on reset. Fixes #1001

This commit is contained in:
Mottie 2015-08-26 07:22:48 -05:00
parent 41fb194559
commit 3282dc52fc
8 changed files with 36 additions and 36 deletions

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 08-23-2015 (v2.23.2)*/
/*! tablesorter (FORK) - updated 08-26-2015 (v2.23.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -2771,7 +2771,7 @@
.split( ' ' ).join( c.namespace + 'filter ' );
$table
.removeClass( 'hasFilters' )
// add .tsfilter namespace to all BUT search
// add filter namespace to all BUT search
.unbind( events.replace( ts.regex.spaces, ' ' ) )
// remove the filter row even if refreshing, because the column might have been moved
.find( '.' + tscss.filterRow ).remove();
@ -2782,7 +2782,7 @@
ts.processTbody( table, $tbody, false ); // restore tbody
}
if ( wo.filter_reset ) {
$( document ).undelegate( wo.filter_reset, 'click.tsfilter' );
$( document ).undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' );
}
}
});
@ -3152,8 +3152,8 @@
} else if ( $( wo.filter_reset ).length ) {
// reset is a jQuery selector, use event delegation
$( document )
.undelegate( wo.filter_reset, 'click.tsfilter' )
.delegate( wo.filter_reset, 'click.tsfilter', function() {
.undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' )
.delegate( wo.filter_reset, 'click' + c.namespace + 'filter', function() {
// trigger a reset event, so other functions ( filter_formatter ) know when to reset
c.$table.trigger( 'filterReset' );
});
@ -4315,7 +4315,7 @@
}
$column
.val( setFilters[ i ] )
.trigger( 'change.tsfilter' );
.trigger( 'change' );
} else {
filters[i] = $column.val() || '';
// don't change the first... it will move the cursor

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 08-23-2015 (v2.23.2)*/
/*! tablesorter (FORK) - updated 08-26-2015 (v2.23.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -429,7 +429,7 @@
.split( ' ' ).join( c.namespace + 'filter ' );
$table
.removeClass( 'hasFilters' )
// add .tsfilter namespace to all BUT search
// add filter namespace to all BUT search
.unbind( events.replace( ts.regex.spaces, ' ' ) )
// remove the filter row even if refreshing, because the column might have been moved
.find( '.' + tscss.filterRow ).remove();
@ -440,7 +440,7 @@
ts.processTbody( table, $tbody, false ); // restore tbody
}
if ( wo.filter_reset ) {
$( document ).undelegate( wo.filter_reset, 'click.tsfilter' );
$( document ).undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' );
}
}
});
@ -810,8 +810,8 @@
} else if ( $( wo.filter_reset ).length ) {
// reset is a jQuery selector, use event delegation
$( document )
.undelegate( wo.filter_reset, 'click.tsfilter' )
.delegate( wo.filter_reset, 'click.tsfilter', function() {
.undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' )
.delegate( wo.filter_reset, 'click' + c.namespace + 'filter', function() {
// trigger a reset event, so other functions ( filter_formatter ) know when to reset
c.$table.trigger( 'filterReset' );
});
@ -1973,7 +1973,7 @@
}
$column
.val( setFilters[ i ] )
.trigger( 'change.tsfilter' );
.trigger( 'change' );
} else {
filters[i] = $column.val() || '';
// don't change the first... it will move the cursor

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 08-23-2015 (v2.23.2)*/
/*! tablesorter (FORK) - updated 08-26-2015 (v2.23.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -2777,7 +2777,7 @@
.split( ' ' ).join( c.namespace + 'filter ' );
$table
.removeClass( 'hasFilters' )
// add .tsfilter namespace to all BUT search
// add filter namespace to all BUT search
.unbind( events.replace( ts.regex.spaces, ' ' ) )
// remove the filter row even if refreshing, because the column might have been moved
.find( '.' + tscss.filterRow ).remove();
@ -2788,7 +2788,7 @@
ts.processTbody( table, $tbody, false ); // restore tbody
}
if ( wo.filter_reset ) {
$( document ).undelegate( wo.filter_reset, 'click.tsfilter' );
$( document ).undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' );
}
}
});
@ -3158,8 +3158,8 @@
} else if ( $( wo.filter_reset ).length ) {
// reset is a jQuery selector, use event delegation
$( document )
.undelegate( wo.filter_reset, 'click.tsfilter' )
.delegate( wo.filter_reset, 'click.tsfilter', function() {
.undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' )
.delegate( wo.filter_reset, 'click' + c.namespace + 'filter', function() {
// trigger a reset event, so other functions ( filter_formatter ) know when to reset
c.$table.trigger( 'filterReset' );
});
@ -4321,7 +4321,7 @@
}
$column
.val( setFilters[ i ] )
.trigger( 'change.tsfilter' );
.trigger( 'change' );
} else {
filters[i] = $column.val() || '';
// don't change the first... it will move the cursor

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 08-23-2015 (v2.23.2)*/
/*! tablesorter (FORK) - updated 08-26-2015 (v2.23.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -435,7 +435,7 @@
.split( ' ' ).join( c.namespace + 'filter ' );
$table
.removeClass( 'hasFilters' )
// add .tsfilter namespace to all BUT search
// add filter namespace to all BUT search
.unbind( events.replace( ts.regex.spaces, ' ' ) )
// remove the filter row even if refreshing, because the column might have been moved
.find( '.' + tscss.filterRow ).remove();
@ -446,7 +446,7 @@
ts.processTbody( table, $tbody, false ); // restore tbody
}
if ( wo.filter_reset ) {
$( document ).undelegate( wo.filter_reset, 'click.tsfilter' );
$( document ).undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' );
}
}
});
@ -816,8 +816,8 @@
} else if ( $( wo.filter_reset ).length ) {
// reset is a jQuery selector, use event delegation
$( document )
.undelegate( wo.filter_reset, 'click.tsfilter' )
.delegate( wo.filter_reset, 'click.tsfilter', function() {
.undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' )
.delegate( wo.filter_reset, 'click' + c.namespace + 'filter', function() {
// trigger a reset event, so other functions ( filter_formatter ) know when to reset
c.$table.trigger( 'filterReset' );
});
@ -1979,7 +1979,7 @@
}
$column
.val( setFilters[ i ] )
.trigger( 'change.tsfilter' );
.trigger( 'change' );
} else {
filters[i] = $column.val() || '';
// don't change the first... it will move the cursor

View File

@ -61,7 +61,7 @@
.split( ' ' ).join( c.namespace + 'filter ' );
$table
.removeClass( 'hasFilters' )
// add .tsfilter namespace to all BUT search
// add filter namespace to all BUT search
.unbind( events.replace( ts.regex.spaces, ' ' ) )
// remove the filter row even if refreshing, because the column might have been moved
.find( '.' + tscss.filterRow ).remove();
@ -72,7 +72,7 @@
ts.processTbody( table, $tbody, false ); // restore tbody
}
if ( wo.filter_reset ) {
$( document ).undelegate( wo.filter_reset, 'click.tsfilter' );
$( document ).undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' );
}
}
});
@ -442,8 +442,8 @@
} else if ( $( wo.filter_reset ).length ) {
// reset is a jQuery selector, use event delegation
$( document )
.undelegate( wo.filter_reset, 'click.tsfilter' )
.delegate( wo.filter_reset, 'click.tsfilter', function() {
.undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' )
.delegate( wo.filter_reset, 'click' + c.namespace + 'filter', function() {
// trigger a reset event, so other functions ( filter_formatter ) know when to reset
c.$table.trigger( 'filterReset' );
});
@ -1605,7 +1605,7 @@
}
$column
.val( setFilters[ i ] )
.trigger( 'change.tsfilter' );
.trigger( 'change' );
} else {
filters[i] = $column.val() || '';
// don't change the first... it will move the cursor