Merge "Replace jQuery.grep with Array.prototype.filter"

This commit is contained in:
jenkins-bot 2018-09-03 15:40:49 +00:00 committed by Gerrit Code Review
commit 15df919bc1

View file

@ -367,7 +367,7 @@ ve.ui.MWCategoryWidget.prototype.addItems = function ( items, index ) {
// Index item
widget.categories[ itemTitle.getMainText() ] = categoryItem;
// Copy sortKey from old item when "moving"
existingCategoryItems = $.grep( widget.items, checkValueMatches );
existingCategoryItems = widget.items.filter( checkValueMatches );
if ( existingCategoryItems.length ) {
// There should only be one element in existingCategoryItems
categoryItem.sortKey = existingCategoryItems[ 0 ].sortKey;