/*!
* JavaScript for Special:Preferences: editfont field enhancements.
*/
-( function ( mw, $ ) {
- $( function () {
- var widget, lastValue;
+( function () {
+ mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
+ var widget, lastValue,
+ $target = $root.find( '#mw-input-wpeditfont' );
+
+ if (
+ !$target.length ||
+ $target.closest( '.mw-htmlform-autoinfuse-lazy' ).length
+ ) {
+ return;
+ }
try {
- widget = OO.ui.infuse( $( '#mw-input-wpeditfont' ) );
+ widget = OO.ui.infuse( $target );
} catch ( err ) {
// This preference could theoretically be disabled ($wgHiddenPrefs)
return;
updateLabel( widget.getValue() );
} );
-}( mediaWiki, jQuery ) );
+}() );