/* eslint-disable no-jquery/no-global-selector */ $( () => { const mobileMediaQuery = window.matchMedia( 'screen and (max-width: 550px)' ), isResponsive = document.body.classList.contains( 'skin--responsive' ), echo = require( './mobile-echo.js' ), uls = require( './mobile-uls.js' ), // Toggles and targets for popouts toggles = { '#sidebar-toggle': '#sidebar-mobilejs', '#p-personal-toggle': '#p-personal', '#ca-more a': '#p-cactions', '#ca-languages a': '#p-lang', '#ca-tools a': '#p-tb' }; // Track if DOM has been set up for mobile fanciness yet let monobookMobileElements = false; // Close menus function closeMenus() { $( '.mobile-menu-active' ).removeClass( 'mobile-menu-active' ); $( '.menus-cover' ).removeClass( 'visible' ); } // Set up DOM for mobile fanciness // We don't automatically do this because MonoBook; most users will be on desktop function setupMonoBookMobile() { if ( !monobookMobileElements && mobileMediaQuery.matches ) { // Duplicate nav $( '#column-one' ).append( $( '#sidebar' ).clone().find( '*' ).addBack().each( function () { if ( this.id ) { this.id = this.id + '-mobilejs'; } } ).end().end() ); // Thing to fade out the content while menus are active $( '#column-one' ).append( $( '