Merge "Remove disable dropdown behavior"

This commit is contained in:
jenkins-bot 2021-09-13 07:05:25 +00:00 committed by Gerrit Code Review
commit 82832b137a
2 changed files with 0 additions and 42 deletions

View File

@ -19,40 +19,9 @@ function addInterwikiLinkToSidebar() {
}
}
/**
* Disable dropdown behaviour for non-JS users.
*
* @param {HTMLElement|null} pLangBtn
* @return {void}
*/
function disableDropdownBehavior( pLangBtn ) {
if ( !pLangBtn ) {
return;
}
pLangBtn.classList.add( 'vector-menu-hide-dropdown' );
}
/**
* Checks whether ULS is enabled and if so disables the default
* drop down behavior of the button.
*/
function disableLanguageDropdown() {
var ulsModuleStatus = mw.loader.getState( 'ext.uls.interface' );
// If module status is defined and not registered we can assume it is in the process of loading
if ( ulsModuleStatus && ulsModuleStatus !== 'registered' ) {
// HACK: Ideally knowledge of internal ULS configuration would not be necessary
// In future this should be wired up to an `mw.hook` event.
if ( mw.config.get( 'wgULSisCompactLinksEnabled' ) ) {
disableDropdownBehavior( document.getElementById( 'p-lang-btn' ) );
}
}
}
/**
* Initialize the language button.
*/
module.exports = function () {
disableLanguageDropdown();
addInterwikiLinkToSidebar();
};

View File

@ -63,17 +63,6 @@
}
}
// mw-body-header class can be removed when language button is the default.
// e.g. upon removal of SkinVector::isLanguagesInHeader
.client-js #p-lang-btn {
// When the ext.uls.interface module is loaded, we hide the fallback menu and checkbox.
&.vector-menu-hide-dropdown {
.vector-menu-content {
display: none;
}
}
}
// Hides language button with CSS, ensures language button is in DOM for temporary JS hack for interwiki links
// Temporary solution to T287206, can be removed when ULS dialog includes interwiki links
#p-lang-btn.mw-portlet-empty {