Filter: fix disable live search. See #1152

This commit is contained in:
Rob Garrison 2016-02-04 08:04:36 -06:00
parent b40693a954
commit 90ce03df6e
2 changed files with 3 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -799,8 +799,9 @@
var column = parseInt( $( this ).attr( 'data-column' ), 10 ); var column = parseInt( $( this ).attr( 'data-column' ), 10 );
// don't allow 'change' event to process if the input value is the same - fixes #685 // don't allow 'change' event to process if the input value is the same - fixes #685
if ( wo.filter_initialized && ( event.which === tskeyCodes.enter || event.type === 'search' || if ( wo.filter_initialized && ( event.which === tskeyCodes.enter || event.type === 'search' ||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
// only "input" event fires in MS Edge when clicking the "x" to clear the search // only "input" event fires in MS Edge when clicking the "x" to clear the search
( event.type === 'change' || event.type === 'input' ) && this.value !== c.lastSearch[column] ) ) { ( event.type === 'input' && this.value === '' ) ) {
event.preventDefault(); event.preventDefault();
// init search with no delay // init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );