Merge "Delete last template search result, not a random one"

This commit is contained in:
jenkins-bot 2021-07-09 16:07:37 +00:00 committed by Gerrit Code Review
commit 530bdbf00e

View file

@ -235,7 +235,9 @@ ve.ui.MWTemplateTitleInputWidget.prototype.addExactMatch = function ( response )
newPage.index = 1;
pages.unshift( newPage );
if ( pages.length > widget.limit ) {
pages.splice( widget.limit );
pages.sort( function ( a, b ) {
return a.index - b.index;
} ).splice( widget.limit );
}
}
}