mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 15:53:46 +00:00
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:
parent
c08ae1152e
commit
c8dd4e9ed1
|
@ -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.
|
* Initialize the language button.
|
||||||
*/
|
*/
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
disableLanguageDropdown();
|
|
||||||
addInterwikiLinkToSidebar();
|
addInterwikiLinkToSidebar();
|
||||||
};
|
};
|
||||||
|
|
|
@ -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
|
// 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
|
// Temporary solution to T287206, can be removed when ULS dialog includes interwiki links
|
||||||
#p-lang-btn.mw-portlet-empty {
|
#p-lang-btn.mw-portlet-empty {
|
||||||
|
|
Loading…
Reference in a new issue