diff --git a/includes/Hooks.php b/includes/Hooks.php index 3a86891b..21699fb2 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -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. diff --git a/resources/js/ext.uls.compactlinks.js b/resources/js/ext.uls.compactlinks.js index 65fd2666..f94c37b3 100644 --- a/resources/js/ext.uls.compactlinks.js +++ b/resources/js/ext.uls.compactlinks.js @@ -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.loader.using( '@wikimedia/codex' ).then( function () { + this.addTrigger(); + }.bind( this ) ); mw.hook( 'mw.uls.compactlinks.initialized' ).fire( true ); };