Use document.body instead of 'body' as jQuery selector

Change-Id: Ia551b3050ed546de1f9db44dbd332a5b6c108a9f
This commit is contained in:
Fomafix
2019-12-16 11:05:57 +01:00
committed by jenkins-bot
parent 6d97927ad2
commit 61ebecff91
10 changed files with 18 additions and 18 deletions

View File

@@ -121,7 +121,7 @@
*/
render: function () {
this.$parent.$settingsPanel.empty();
this.$webfonts = $( 'body' ).data( 'webfonts' );
this.$webfonts = $( document.body ).data( 'webfonts' );
this.$parent.$settingsPanel.append( this.$template );
this.prepareLanguages();
this.prepareUIFonts();
@@ -551,7 +551,7 @@
// Allow the webfonts library to finish loading
setTimeout( function () {
displaySettings.$webfonts = $( 'body' ).data( 'webfonts' );
displaySettings.$webfonts = $( document.body ).data( 'webfonts' );
mw.webfonts.preferences.enable();

View File

@@ -217,7 +217,7 @@
mw.hook( 'mw.uls.webfonts.enable' ).add( enableWebfonts );
mw.hook( 'mw.uls.webfonts.disable' ).add( disableWebfonts );
$( 'body' ).on(
$( document.body ).on(
'noresults.uls',
'.uls-menu .uls-languagefilter',
noSearchResults

View File

@@ -226,7 +226,7 @@
var imeSelectors = mw.config.get( 'wgULSImeSelectors' ).join( ', ' );
mw.ime.init();
$( 'body' ).on( 'focus.ime', imeSelectors, function () {
$( document.body ).on( 'focus.ime', imeSelectors, function () {
mw.ime.handleFocus( $( this ) );
} );
};

View File

@@ -80,11 +80,11 @@
*/
render: function () {
var $enabledOnly,
webfonts = $( 'body' ).data( 'webfonts' );
webfonts = $( document.body ).data( 'webfonts' );
this.dirty = false;
this.$parent.$settingsPanel.empty();
this.$imes = $( 'body' ).data( 'ime' );
this.$imes = $( document.body ).data( 'ime' );
this.$parent.$settingsPanel.append( this.$template );
$enabledOnly = this.$template.find( '.enabled-only' );
if ( $.ime.preferences.isEnabled() ) {

View File

@@ -218,7 +218,7 @@
}() )
} );
ulsPopup.$element.appendTo( 'body' );
ulsPopup.$element.appendTo( document.body );
// The interlanguage position needs some time to settle down
setTimeout( function () {
@@ -435,9 +435,9 @@
function initIme() {
var imeSelector = mw.config.get( 'wgULSImeSelectors' ).join( ', ' );
$( 'body' ).on( 'focus.imeinit', imeSelector, function () {
$( document.body ).on( 'focus.imeinit', imeSelector, function () {
var $input = $( this );
$( 'body' ).off( '.imeinit' );
$( document.body ).off( '.imeinit' );
mw.loader.using( 'ext.uls.ime', function () {
mw.ime.setup();
mw.ime.handleFocus( $input );

View File

@@ -68,7 +68,7 @@
constructor: LanguageSettings,
init: function () {
$( 'body' ).append( this.$window );
$( document.body ).append( this.$window );
this.hide();
},

View File

@@ -147,10 +147,10 @@
mw.uls = mw.uls || {};
mw.uls.preferences = function () {
var data = $( 'body' ).data( 'preferences' );
var data = $( document.body ).data( 'preferences' );
if ( !data ) {
$( 'body' ).data( 'preferences', ( data = new ULSPreferences() ) );
$( document.body ).data( 'preferences', ( data = new ULSPreferences() ) );
}
return data;
};

View File

@@ -72,7 +72,7 @@
// MediaWiki specific overrides for jquery.webfonts
$.extend( $.fn.webfonts.defaults, {
repository: mediawikiFontRepository,
fontStack: $( 'body' ).css( 'font-family' ).split( /, /g ),
fontStack: $( document.body ).css( 'font-family' ).split( /, /g ),
/**
* Returns a suitable font from font repository based
* on the given language and html classes and user preference.
@@ -127,7 +127,7 @@
// This is important because webfonts behavior depends on the font-family
// property values set by stylesheets.
setTimeout( function () {
$( 'body' ).webfonts();
$( document.body ).webfonts();
}, 0 );
};

View File

@@ -32,7 +32,7 @@
// MediaWiki specific overrides for jquery.webfonts
$.extend( $.fn.webfonts.defaults, {
repository: mediawikiFontRepository,
fontStack: $( 'body' ).css( 'font-family' ).split( /, /g ),
fontStack: $( document.body ).css( 'font-family' ).split( /, /g ),
fontSelector: function ( repository, language ) {
var font = repository.defaultFont( language );
@@ -45,7 +45,7 @@
}
} );
$( 'body' ).webfonts();
$( document.body ).webfonts();
} );
}() );