Remove disable dropdown behavior

Now that we bind the ULS dialog to the checkbox element,
(see c08ae11) the default behaviour of the checkbos is prevented,
so it is impossible for the dropdown to ever
be shown when ULS is enabled and clicked so this code no longer
serves any purpose.

Depends-On: I97a69c30b27cb1ded06451389e086229561c3589
Change-Id: Ic9d03dea12ee8bb2d7430eccd70e4343e3805d36
This commit is contained in:
jdlrobson 2021-08-31 12:22:25 -07:00 committed by Jdlrobson
parent c08ae1152e
commit c8dd4e9ed1
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

@ -65,17 +65,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 {