Simplify function to check for standalone language button.
Change-Id: I4d4afa0e5098736e40e49924e87f471b3d09257a
This commit is contained in:
@@ -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' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user