2 * HTMLForm enhancements:
3 * Set up autocomplete fields.
7 mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
8 var $autocomplete = $root.find( '.mw-htmlform-autocomplete' );
9 if ( $autocomplete.length ) {
10 mw.loader.using( 'jquery.suggestions', function () {
11 $autocomplete.suggestions( {
12 fetch: function ( val ) {
14 $el.suggestions( 'suggestions',
15 $.grep( $el.data( 'autocomplete' ), function ( v ) {
16 return v.indexOf( val ) === 0;
25 }( mediaWiki, jQuery ) );