Fix var error in fnSetFilteringDelay - just a warning, but good to tidy up

pull/2/head
Allan Jardine 13 years ago
parent 064cc451a0
commit 5db3b46e8e

@ -12,32 +12,34 @@
*/ */
jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) { jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {
var var _that = this;
_that = this,
iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay; if ( iDelay === undefined ) {
iDelay = 250;
this.each( function ( i ) { }
$.fn.dataTableExt.iApiIndex = i;
var this.each( function ( i ) {
$this = this, $.fn.dataTableExt.iApiIndex = i;
oTimerId = null, var
sPreviousSearch = null, $this = this,
anControl = $( 'input', _that.fnSettings().aanFeatures.f ); oTimerId = null,
sPreviousSearch = null,
anControl.unbind( 'keyup' ).bind( 'keyup', function() { anControl = $( 'input', _that.fnSettings().aanFeatures.f );
var $$this = $this;
anControl.unbind( 'keyup' ).bind( 'keyup', function() {
var $$this = $this;
if (sPreviousSearch === null || sPreviousSearch != anControl.val()) { if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
window.clearTimeout(oTimerId); window.clearTimeout(oTimerId);
sPreviousSearch = anControl.val(); sPreviousSearch = anControl.val();
oTimerId = window.setTimeout(function() { oTimerId = window.setTimeout(function() {
$.fn.dataTableExt.iApiIndex = i; $.fn.dataTableExt.iApiIndex = i;
_that.fnFilter( anControl.val() ); _that.fnFilter( anControl.val() );
}, iDelay); }, iDelay);
} }
}); });
return this; return this;
} ); } );
return this; return this;
}; };

Loading…
Cancel
Save