mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Merge "Delete last template search result, not a random one"
This commit is contained in:
commit
530bdbf00e
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue