]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Whitespace.
authorScott González <scott.gonzalez@gmail.com>
Fri, 27 May 2011 12:35:18 +0000 (08:35 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 27 May 2011 12:35:18 +0000 (08:35 -0400)
demos/autocomplete/search.php
ui/jquery.ui.autocomplete.js

index cbe78a52a119fcda789c390d5dfc395b035f8127..835772deea82afe72aa84aa57c9dc9a087c60b1e 100644 (file)
@@ -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"]);
index f6573174ad48becf87dc9f79b6131f065b8d6d58..4619949fb7101b815aeca7c612f59671e8dc5477 100644 (file)
@@ -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 ) {