Permalink
Browse files

Autocomplete: Whitespace.

  • Loading branch information...
1 parent be7da02 commit 8a972f5cce2b84a431a700201cdf649edd2f4ac7 @scottgonzalez scottgonzalez committed May 27, 2011
Showing with 9 additions and 7 deletions.
  1. +2 −0 demos/autocomplete/search.php
  2. +7 −7 ui/jquery.ui.autocomplete.js
@@ -1,4 +1,6 @@
<?php
+
+sleep( 3 );
// no term passed - just exit early with no response
if (empty($_GET['term'])) exit ;
$q = strtolower($_GET["term"]);
@@ -63,7 +63,7 @@ $.widget( "ui.autocomplete", {
})
.bind( "keydown.autocomplete", function( event ) {
if ( self.options.disabled || self.element.attr( "readonly" ) ) {
- suppressKeyPress = true;
+ suppressKeyPress = true;
suppressInput = true;
return;
}
@@ -73,21 +73,21 @@ $.widget( "ui.autocomplete", {
var keyCode = $.ui.keyCode;
switch( event.keyCode ) {
case keyCode.PAGE_UP:
- suppressKeyPress = true;
+ suppressKeyPress = true;
self._move( "previousPage", event );
break;
case keyCode.PAGE_DOWN:
- suppressKeyPress = true;
+ suppressKeyPress = true;
self._move( "nextPage", event );
break;
case keyCode.UP:
- suppressKeyPress = true;
+ suppressKeyPress = true;
self._move( "previous", event );
// prevent moving cursor to beginning of text field in some browsers
event.preventDefault();
break;
case keyCode.DOWN:
- suppressKeyPress = true;
+ suppressKeyPress = true;
self._move( "next", event );
// prevent moving cursor to end of text field in some browsers
event.preventDefault();
@@ -122,7 +122,7 @@ $.widget( "ui.autocomplete", {
if ( suppressKeyPress ) {
suppressKeyPress = false;
event.preventDefault();
- return;
+ return;
}
// replicate some key handlers to allow them to repeat in Firefox and Opera
@@ -144,7 +144,7 @@ $.widget( "ui.autocomplete", {
// prevent moving cursor to end of text field in some browsers
event.preventDefault();
break;
- }
+ }
})
.bind( "input.autocomplete", function(event) {
if ( suppressInput ) {

0 comments on commit 8a972f5

Please sign in to comment.