Skip to content

Commit

Permalink
Filter: restore filter_searchDelay function. See #1299
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Nov 22, 2016
1 parent 2e2a133 commit 8c72f40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/widgets/widget-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,11 +827,15 @@
// include change for select - fixes #473
.bind( 'search change keypress input '.split( ' ' ).join( namespace + ' ' ), function( event ) {
// don't get cached data, in case data-column changes dynamically
var column = parseInt( $( this ).attr( 'data-column' ), 10 );
var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
wo.filter_liveSearch :
ts.getColumnData( table, wo.filter_liveSearch, column );
// don't allow 'change' event to process if the input value is the same - fixes #685
if ( table.config.widgetOptions.filter_initialized &&
( event.which === tskeyCodes.enter || event.type === 'search' ||
( event.type === 'change' || event.type === 'input' ) &&
( event.type === 'change' ||
( event.type === 'input' && liveSearch === true ) ) &&
this.value !== c.lastSearch[column] )
) {
event.preventDefault();
Expand Down

0 comments on commit 8c72f40

Please sign in to comment.