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
|
* For Vector, check if the language button id exists.
|
||||||
* on the contents of the page.
|
* For other skins, check wgULSDisplaySettingsInInterlanguage for the current skin.
|
||||||
* For other skins, check if ULSDisplayInputAndDisplaySettingsInInterlanguage contains the current skin.
|
|
||||||
*
|
*
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
function isUsingStandaloneLanguageButton() {
|
function isUsingStandaloneLanguageButton() {
|
||||||
var skin = mw.config.get( 'skin' );
|
// Checking for the ULS language button id returns true for Vector, false for other skins.
|
||||||
// special handling for Vector.
|
return $( '#p-lang-btn' ).length > 0 || mw.config.get( 'wgULSDisplaySettingsInInterlanguage' );
|
||||||
return skin === 'vector' ? $( '#p-lang-btn' ).length > 0 :
|
|
||||||
mw.config.get( 'wgULSDisplaySettingsInInterlanguage' );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user