Force anonymous mode also in when the ULS is not shown in the sidebar

Change-Id: Ie82cfa06d32eb45f0c91e01135cff0bd481682b9
This commit is contained in:
Amir E. Aharoni
2013-05-07 11:46:16 +03:00
parent 15ccc41f49
commit d124a118a3

View File

@@ -24,6 +24,7 @@
var $ulsTrigger, $pLang,
ulsOptions,
previousLanguages, previousLang,
anonMode,
rtlPage = $( 'body' ).hasClass( 'rtl' ),
ulsPosition = mw.config.get( 'wgULSPosition' ),
tipsyGravity = {
@@ -32,6 +33,9 @@
},
currentLang = mw.config.get( 'wgUserLanguage' );
anonMode = ( mw.user.isAnon() &&
!mw.config.get( 'wgULSAnonCanChangeLanguage' ) );
if ( ulsPosition === 'interlanguage' ) {
// The interlanguage links section
$pLang = $( '#p-lang' );
@@ -86,8 +90,9 @@
// If the ULS trigger is shown in the top personal menu,
// closing the display settings must show the main ULS
// languages list
if ( ulsPosition === 'personal' ) {
// languages list, unless we are in anon mode and thus
// cannot show the language list
if ( ulsPosition === 'personal' && !anonMode ) {
displaySettingsOptions.onClose = function () {
uls.show();
};
@@ -200,6 +205,10 @@
);
};
} else if ( anonMode ) {
ulsOptions.onVisible = function () {
this.$menu.find( '#display-settings-block' ).click();
};
}
$ulsTrigger.uls( ulsOptions );