Use document.body instead of 'body' as jQuery selector
Change-Id: Ia551b3050ed546de1f9db44dbd332a5b6c108a9f
This commit is contained in:
@@ -343,7 +343,7 @@
|
||||
* Destroy the binding of ime to the editable element
|
||||
*/
|
||||
destroy: function () {
|
||||
$( 'body' ).off( '.ime' );
|
||||
$( document.body ).off( '.ime' );
|
||||
this.$element.off( '.ime' ).removeData( 'ime' ).removeData( 'imeselector' );
|
||||
},
|
||||
|
||||
@@ -972,7 +972,7 @@
|
||||
}
|
||||
|
||||
this.$imeSetting.append( this.$menu );
|
||||
$( 'body' ).append( this.$imeSetting );
|
||||
$( document.body ).append( this.$imeSetting );
|
||||
},
|
||||
|
||||
stopTimer: function () {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ) );
|
||||
} );
|
||||
};
|
||||
|
||||
@@ -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() ) {
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
constructor: LanguageSettings,
|
||||
|
||||
init: function () {
|
||||
$( 'body' ).append( this.$window );
|
||||
$( document.body ).append( this.$window );
|
||||
this.hide();
|
||||
},
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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 );
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
} );
|
||||
|
||||
}() );
|
||||
|
||||
Reference in New Issue
Block a user