2 * JavaScript for Special:Preferences: editfont field enhancements.
9 widget
= OO
.ui
.infuse( $( '#mw-input-wpeditfont' ) );
11 // This preference could theoretically be disabled ($wgHiddenPrefs)
16 widget
.dropdownWidget
.menu
.items
.forEach( function ( item
) {
17 item
.$label
.addClass( 'mw-editfont-' + item
.getData() );
20 function updateLabel( value
) {
21 // Style selected item label
22 widget
.dropdownWidget
.$label
23 .removeClass( 'mw-editfont-' + lastValue
)
24 .addClass( 'mw-editfont-' + value
);
28 widget
.on( 'change', updateLabel
);
29 updateLabel( widget
.getValue() );
32 }( mediaWiki
, jQuery
) );