Merge "resources: Strip '$' and 'mw' from file closures"
[lhc/web/wiklou.git] / resources / src / mediawiki.htmlform / autocomplete.js
index 8157975..b49db93 100644 (file)
@@ -2,7 +2,7 @@
  * HTMLForm enhancements:
  * Set up autocomplete fields.
  */
-( function ( mw, $ ) {
+( function () {
 
        mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
                var $autocomplete = $root.find( '.mw-htmlform-autocomplete' );
@@ -12,7 +12,7 @@
                                        fetch: function ( val ) {
                                                var $el = $( this );
                                                $el.suggestions( 'suggestions',
-                                                       $.grep( $el.data( 'autocomplete' ), function ( v ) {
+                                                       $el.data( 'autocomplete' ).filter( function ( v ) {
                                                                return v.indexOf( val ) === 0;
                                                        } )
                                                );
@@ -22,4 +22,4 @@
                }
        } );
 
-}( mediaWiki, jQuery ) );
+}() );