mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 19:26:46 +00:00
Merge "Replace jQuery.grep with Array.prototype.filter"
This commit is contained in:
commit
15df919bc1
|
@ -367,7 +367,7 @@ ve.ui.MWCategoryWidget.prototype.addItems = function ( items, index ) {
|
||||||
// Index item
|
// Index item
|
||||||
widget.categories[ itemTitle.getMainText() ] = categoryItem;
|
widget.categories[ itemTitle.getMainText() ] = categoryItem;
|
||||||
// Copy sortKey from old item when "moving"
|
// Copy sortKey from old item when "moving"
|
||||||
existingCategoryItems = $.grep( widget.items, checkValueMatches );
|
existingCategoryItems = widget.items.filter( checkValueMatches );
|
||||||
if ( existingCategoryItems.length ) {
|
if ( existingCategoryItems.length ) {
|
||||||
// There should only be one element in existingCategoryItems
|
// There should only be one element in existingCategoryItems
|
||||||
categoryItem.sortKey = existingCategoryItems[ 0 ].sortKey;
|
categoryItem.sortKey = existingCategoryItems[ 0 ].sortKey;
|
||||||
|
|
Loading…
Reference in a new issue