Skip to content

Commit

Permalink
Filter: use namespacing on reset. Fixes #1001
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Aug 26, 2015
1 parent 41fb194 commit 3282dc5
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions dist/js/jquery.tablesorter.combined.js
@@ -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) {
Expand Down Expand Up @@ -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();
Expand All @@ -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' );
}
}
});
Expand Down Expand Up @@ -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' );
});
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dist/js/jquery.tablesorter.combined.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/js/jquery.tablesorter.widgets.js
@@ -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) {
Expand Down Expand Up @@ -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();
Expand All @@ -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' );
}
}
});
Expand Down Expand Up @@ -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' );
});
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dist/js/jquery.tablesorter.widgets.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/widgets/widget-filter.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions js/jquery.tablesorter.combined.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
Expand All @@ -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' );
}
}
});
Expand Down Expand Up @@ -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' );
});
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions js/jquery.tablesorter.widgets.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
Expand All @@ -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' );
}
}
});
Expand Down Expand Up @@ -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' );
});
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions js/widgets/widget-filter.js
Expand Up @@ -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();
Expand All @@ -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' );
}
}
});
Expand Down Expand Up @@ -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' );
});
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3282dc5

Please sign in to comment.