Simplify function to check for standalone language button.

Change-Id: I4d4afa0e5098736e40e49924e87f471b3d09257a
This commit is contained in:
Clare Ming
2022-01-11 17:22:34 -07:00
committed by jenkins-bot
parent 532a865b7b
commit f539619b1c

View File

@@ -53,17 +53,14 @@
}
/**
* For Vector: Check whether the classic Vector or "new" vector ([[mw:Desktop_improvements]]) is enabled based
* on the contents of the page.
* For other skins, check if ULSDisplayInputAndDisplaySettingsInInterlanguage contains the current skin.
* For Vector, check if the language button id exists.
* For other skins, check wgULSDisplaySettingsInInterlanguage for the current skin.
*
* @return {boolean}
*/
function isUsingStandaloneLanguageButton() {
var skin = mw.config.get( 'skin' );
// special handling for Vector.
return skin === 'vector' ? $( '#p-lang-btn' ).length > 0 :
mw.config.get( 'wgULSDisplaySettingsInInterlanguage' );
// Checking for the ULS language button id returns true for Vector, false for other skins.
return $( '#p-lang-btn' ).length > 0 || mw.config.get( 'wgULSDisplaySettingsInInterlanguage' );
}
/**