Clean up hacky code that avoids loading @wikimedia/codex in vector 2022
This code was introduced as a hotfix for avoiding loading @wikimedia/codex module in vector 2022 skin, in I44835e672bce97a7d3a98d9d75c4805ee2cc448d. Now that the issue has been properly handled after this patch (I43551be73da2126fd84ffaa0d37faec58bc47135) has been merged, we can remove this code. Bug: T353850 Change-Id: I458a0a6835caedb25bfaa1c58800fb9ce849fb1b
This commit is contained in:
@@ -121,6 +121,8 @@ class Hooks implements
|
||||
if ( !$this->config->get( 'ULSEnable' ) ) {
|
||||
return false;
|
||||
}
|
||||
// Compact links should be disabled in Vector 2022 skin,
|
||||
// when the language button is displayed at the top of the content
|
||||
if ( $skin->getSkinName() === 'vector-2022' ) {
|
||||
return !$this->isLanguageInHeader( $skin );
|
||||
}
|
||||
@@ -184,11 +186,6 @@ class Hooks implements
|
||||
'wgVector2022LanguageInHeader' => $isVector2022LanguageInHeader
|
||||
];
|
||||
|
||||
// Load compact links if no mw-interlanguage-selector element is present in the page HTML.
|
||||
// Note if the element is rendered by the skin, its assumed that no collapsing is needed.
|
||||
// See T264824 for more information.
|
||||
// Note for Vector 2022, this skin is loaded as it tightly-coupled with ext.uls.interface
|
||||
// A client side check avoids loading @wikimedia/codex for that skin.
|
||||
if ( !$override && $isCompactLinksEnabled ) {
|
||||
$out->addModules( 'ext.uls.compactlinks' );
|
||||
// Add styles for the default button in the page.
|
||||
|
||||
@@ -191,11 +191,9 @@
|
||||
}
|
||||
// If there is an interlanguage selector in the page already
|
||||
// there is no need to add a trigger and Codex styles (T353850).
|
||||
if ( !$( '.mw-interlanguage-selector' ).length ) {
|
||||
mw.loader.using( '@wikimedia/codex' ).then( function () {
|
||||
this.addTrigger();
|
||||
}.bind( this ) );
|
||||
}
|
||||
|
||||
mw.hook( 'mw.uls.compactlinks.initialized' ).fire( true );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user