jquery.suggestions: Trigger keypress on initializing
[lhc/web/wiklou.git] / resources / src / jquery / jquery.suggestions.js
index a585cf3..9e6ecc8 100644 (file)
                                                }
                                                $.suggestions.hide( context );
                                                $.suggestions.cancel( context );
-                                       } );
+                                       } )
+                                       // Simulate a keypress on load. This loads the search suggestions when there are already
+                                       // typed characters before the JavaScript is loaded.
+                                       .trigger( 'keypress' );
                        }
 
                        // Store the context for next time