mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
Merge "Check last existing category for whether or not we're trying to re-add it"
This commit is contained in:
commit
d69960aa1a
|
@ -142,6 +142,8 @@ ve.ui.MWCategoryInputWidget.prototype.getLookupMenuItemsFromData = function ( da
|
|||
} );
|
||||
|
||||
// Existing categories
|
||||
// This is deliberately not checking the last existingCategories entry so we don't show it under
|
||||
// "Move this category here" etc. That is done below.
|
||||
for ( i = 0, len = existingCategories.length - 1; i < len; i++ ) {
|
||||
item = existingCategories[i];
|
||||
// Verify that item starts with category.value
|
||||
|
@ -152,6 +154,10 @@ ve.ui.MWCategoryInputWidget.prototype.getLookupMenuItemsFromData = function ( da
|
|||
existingCategoryItems.push( item );
|
||||
}
|
||||
}
|
||||
// Now check the last one. Don't add to existingCategoryItems but do make it a match
|
||||
if ( existingCategories[existingCategories.length - 1] === category.value ) {
|
||||
exactMatch = true;
|
||||
}
|
||||
|
||||
// Matching categories
|
||||
for ( i = 0, len = matchingCategories.length; i < len; i++ ) {
|
||||
|
|
Loading…
Reference in a new issue