mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-11 14:06:19 +00:00
Merge "Reduce duplication/clutter in MWParameterResultWidget"
This commit is contained in:
commit
bf4aba90bc
|
@ -43,13 +43,13 @@
|
|||
padding: 0.1em 0.25em;
|
||||
margin-left: 0.5em;
|
||||
color: #54595d;
|
||||
background-color: #eaecf0;
|
||||
background-color: #fff;
|
||||
border: 1px solid #c8ccd1;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.ve-ui-mwParameterResultWidget-name:first-child {
|
||||
background-color: #fff;
|
||||
.ve-ui-mwParameterResultWidget-name.ve-ui-mwParameterResultWidget-alias {
|
||||
background-color: #eaecf0;
|
||||
}
|
||||
|
||||
.ve-ui-mwParameterResultWidget-description {
|
||||
|
|
|
@ -48,7 +48,7 @@ ve.ui.MWParameterResultWidget.prototype.buildLabel = function () {
|
|||
.addClass( 've-ui-mwParameterResultWidget-description' )
|
||||
.text( this.data.description || '' );
|
||||
|
||||
if ( this.data.name ) {
|
||||
if ( this.data.name && this.data.name !== this.data.label ) {
|
||||
$names.append(
|
||||
$( '<span>' )
|
||||
.addClass( 've-ui-mwParameterResultWidget-name' )
|
||||
|
@ -56,9 +56,12 @@ ve.ui.MWParameterResultWidget.prototype.buildLabel = function () {
|
|||
);
|
||||
}
|
||||
for ( i = 0, len = this.data.aliases.length; i < len; i++ ) {
|
||||
if ( this.data.aliases[ i ] === this.data.label ) {
|
||||
continue;
|
||||
}
|
||||
$names.append(
|
||||
$( '<span>' )
|
||||
.addClass( 've-ui-mwParameterResultWidget-name' )
|
||||
.addClass( 've-ui-mwParameterResultWidget-name ve-ui-mwParameterResultWidget-alias' )
|
||||
.text( this.data.aliases[ i ] )
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue