Compact links: The trigger kept pressed while the panel is open

Bug: T70078
Change-Id: Iaac9d7f2a5ec5da049b2b4c8e88a9f0bc2a91bda
This commit is contained in:
Santhosh Thottingal
2016-04-19 16:02:58 +05:30
committed by Niklas Laxström
parent cac3e709de
commit aca1545513
2 changed files with 13 additions and 1 deletions

View File

@@ -20,6 +20,12 @@
text-align: left;
}
.mw-interlanguage-selector:active,
.mw-interlanguage-selector.selector-open {
color: #555555;
background-color: #cccccc;
}
.interlanguage-uls-menu:before {
background: none repeat scroll 0 0 #FCFCFC;
border-left: 1px solid rgba( 0, 0, 0, 0.2 );

View File

@@ -116,6 +116,8 @@
onSelect: function ( language ) {
var previousLanguages = mw.uls.getPreviousLanguages();
compactLinks.$trigger.removeClass( 'selector-open' );
previousLanguages.push( language );
previousLanguages = unique( previousLanguages );
mw.uls.setPreviousLanguages( previousLanguages );
@@ -149,6 +151,7 @@
left: this.left,
top: this.top
} );
compactLinks.$trigger.addClass( 'selector-open' );
},
languageDecorator: function ( $languageLink, language ) {
// set href and text exactly same as what was in
@@ -159,6 +162,9 @@
.prop( 'href', compactLinks.interlanguageList[ language ].href )
.text( compactLinks.interlanguageList[ language ].autonym );
},
onCancel: function () {
compactLinks.$trigger.removeClass( 'selector-open' );
},
// Use compact version of ULS
compact: true,
languages: ulsLanguageList,
@@ -319,7 +325,7 @@
var $trigger;
$trigger = $( '<button>' )
.addClass( 'mw-interlanguage-selector mw-ui-button active' )
.addClass( 'mw-interlanguage-selector mw-ui-button' )
.html( $.i18n(
'ext-uls-compact-link-count',
mw.language.convertNumber( this.listSize - this.compactSize )