* HTMLForm enhancements:
* Set up autocomplete fields.
*/
-( function ( mw, $ ) {
+( function () {
mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
var $autocomplete = $root.find( '.mw-htmlform-autocomplete' );
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;
} )
);
}
} );
-}( mediaWiki, jQuery ) );
+}() );