diff --git a/resources/.eslintrc.json b/resources/.eslintrc.json index 1b09fad..c498c3d 100644 --- a/resources/.eslintrc.json +++ b/resources/.eslintrc.json @@ -4,8 +4,5 @@ "wikimedia/client", "wikimedia/jquery", "wikimedia/mediawiki" - ], - "rules": { - "prefer-const": "warn" - } + ] } diff --git a/resources/mobile-echo.js b/resources/mobile-echo.js index 1af3e2a..0366f3b 100644 --- a/resources/mobile-echo.js +++ b/resources/mobile-echo.js @@ -1,9 +1,9 @@ /* eslint-disable no-jquery/no-global-selector */ module.exports = function () { - let mobileMediaQuery = window.matchMedia( 'screen and (max-width: 550px)' ), - echoHacked = false, + const mobileMediaQuery = window.matchMedia( 'screen and (max-width: 550px)' ), + notifications = $( '#pt-notifications-alert a' ).data( 'counter-num' ) + $( '#pt-notifications-notice a' ).data( 'counter-num' ); + let echoHacked = false, echoHackActive = false, - notifications = $( '#pt-notifications-alert a' ).data( 'counter-num' ) + $( '#pt-notifications-notice a' ).data( 'counter-num' ), notificationsString; // When the icons are clicked for the first time, they are replaced with a JS interface, diff --git a/resources/mobile-uls.js b/resources/mobile-uls.js index ab47c35..bcb8f57 100644 --- a/resources/mobile-uls.js +++ b/resources/mobile-uls.js @@ -1,9 +1,9 @@ /* eslint-disable no-jquery/no-global-selector */ module.exports = function () { mw.loader.using( [ 'ext.uls.interface' ] ).then( () => { - let mobileMediaQuery = window.matchMedia( 'screen and (max-width: 550px)' ), - $ULSTrigger = $( '#pt-uls' ), - ULSMoved = false; + const mobileMediaQuery = window.matchMedia( 'screen and (max-width: 550px)' ), + $ULSTrigger = $( '#pt-uls' ); + let ULSMoved = false; function moveULS() { if ( $ULSTrigger.length ) { diff --git a/resources/skin.js b/resources/skin.js index b74f0c8..6d13ff9 100644 --- a/resources/skin.js +++ b/resources/skin.js @@ -1,11 +1,9 @@ /* eslint-disable no-jquery/no-global-selector */ $( () => { - let mobileMediaQuery = window.matchMedia( 'screen and (max-width: 550px)' ), + 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' ), - // Track if DOM has been set up for mobile fanciness yet - monobookMobileElements = false, // Toggles and targets for popouts toggles = { '#sidebar-toggle': '#sidebar-mobilejs', @@ -14,6 +12,8 @@ $( () => { '#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() {