Modern Vector should be compatible with ULS
Without the following changes the language button shows the wrong label and opens a dialog with zero languages. * Don't apply heading change to modern Vector * Look for the element .mw-portlet-lang as well as #p-lang Bug: T273232 Bug: T273928 Change-Id: Ic201b1983a17cc37fd1ff7c507aab656ea25f370
This commit is contained in:
@@ -236,8 +236,8 @@
|
||||
getBabelLanguages,
|
||||
getSitePicks,
|
||||
getCommonLanguages,
|
||||
this.getLangsInText,
|
||||
this.getLangsWithBadges,
|
||||
this.getLangsInText.bind( this ),
|
||||
this.getLangsWithBadges.bind( this ),
|
||||
getExtraCommonLanguages,
|
||||
getFinalFallback
|
||||
];
|
||||
@@ -300,7 +300,7 @@
|
||||
*/
|
||||
CompactInterlanguageList.prototype.getLangsWithBadges = function () {
|
||||
return Array.prototype.map.call(
|
||||
document.querySelectorAll( '#p-lang [class*="badge"] a.interlanguage-link-target' ),
|
||||
this.listElement.querySelectorAll( '[class*="badge"] a.interlanguage-link-target' ),
|
||||
function ( el ) {
|
||||
return mw.uls.convertMediaWikiLanguageCodeToULS( el.lang );
|
||||
}
|
||||
@@ -382,9 +382,9 @@
|
||||
*/
|
||||
function createCompactList() {
|
||||
var listElement, compactList;
|
||||
listElement = document.querySelector( '#p-lang ul' );
|
||||
listElement = document.querySelector( '.mw-portlet-lang ul, #p-lang ul' );
|
||||
if ( !listElement ) {
|
||||
// Not all namespaces/pages/actions have #p-lang.
|
||||
// Not all namespaces will have a list of languages.
|
||||
return;
|
||||
}
|
||||
compactList = new CompactInterlanguageList( listElement );
|
||||
|
||||
Reference in New Issue
Block a user