Merge "Use document.body and document.documentElement as jQuery selector"

This commit is contained in:
jenkins-bot 2020-01-06 22:25:14 +00:00 committed by Gerrit Code Review
commit c5fc4d05df
3 changed files with 5 additions and 7 deletions

View file

@ -13,7 +13,7 @@ function testScrollLeftStyle() {
dir: 'rtl',
style: 'font-size: 14px; width: 4px; height: 1px; position: absolute; top: -1000px; overflow: scroll;'
} ).text( 'ABCD' );
$definer.appendTo( 'body' );
$definer.appendTo( document.body );
definer = $definer[ 0 ];
if ( definer.scrollLeft > 0 ) {
// Safari, Chrome

View file

@ -135,8 +135,7 @@
// set A-B test class.
// When wgMinervaPageIssuesNewTreatment is the default this can be removed.
if ( newTreatmentEnabled ) {
// eslint-disable-next-line no-jquery/no-global-selector
$( 'html' ).addClass( 'issues-group-B' );
$( document.documentElement ).addClass( 'issues-group-B' );
}
if ( CURRENT_NS === NS_TALK || CURRENT_NS === NS_CATEGORY ) {

View file

@ -149,8 +149,7 @@ module.exports = function ( mobile ) {
.text( mw.message( 'minerva-talk-full-page' ).text() )
.on( 'click', function () {
restoreSectionHeadings();
// eslint-disable-next-line no-jquery/no-global-selector
$( 'body' ).removeClass( 'skin-minerva--talk-simplified' );
$( document.body ).removeClass( 'skin-minerva--talk-simplified' );
$( this ).remove();
// send user back up to top of page so they don't land awkwardly in
// middle of page when it expands
@ -233,8 +232,8 @@ module.exports = function ( mobile ) {
* @return {boolean}
*/
function isSimplifiedViewEnabled() {
// eslint-disable-next-line no-jquery/no-class-state, no-jquery/no-global-selector
return $( 'body' ).hasClass( SKIN_MINERVA_TALK_SIMPLIFIED_CLASS );
// eslint-disable-next-line no-jquery/no-class-state
return $( document.body ).hasClass( SKIN_MINERVA_TALK_SIMPLIFIED_CLASS );
}
/**