mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Merge "Exclude deprecated params from search list"
This commit is contained in:
commit
7fe951e5e1
|
@ -116,7 +116,8 @@ ve.ui.MWParameterSearchWidget.prototype.buildIndex = function () {
|
|||
name: name,
|
||||
label: label,
|
||||
aliases: aliases,
|
||||
description: description
|
||||
description: description,
|
||||
deprecated: spec.isParameterDeprecated( name )
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -146,6 +147,10 @@ ve.ui.MWParameterSearchWidget.prototype.addResults = function () {
|
|||
nameMatch = item.names.indexOf( query ) >= 0;
|
||||
}
|
||||
if ( !hasQuery || textMatch || nameMatch ) {
|
||||
// Only show exact matches for deprecated params
|
||||
if ( item.deprecated && query !== item.name && item.aliases.indexOf( query ) === -1 ) {
|
||||
continue;
|
||||
}
|
||||
items.push( new ve.ui.MWParameterResultWidget( { data: item } ) );
|
||||
if ( hasQuery && nameMatch ) {
|
||||
exactMatch = true;
|
||||
|
|
Loading…
Reference in a new issue