mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
MediaSearch: Order search results correctly
Bug: T117036 Change-Id: Ia11f3486214425f203695a6060e304a90eba7734
This commit is contained in:
parent
1a92da4a58
commit
2c2f8c8a04
|
@ -191,11 +191,14 @@ ve.dm.MWMediaResourceProvider.prototype.fetchAPIresults = function ( howMany ) {
|
|||
}
|
||||
newObj = raw[ page ].imageinfo[ 0 ];
|
||||
newObj.title = raw[ page ].title;
|
||||
newObj.index = raw[ page ].index;
|
||||
results.push( newObj );
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
return results.sort( function ( a, b ) {
|
||||
return a.index - b.index;
|
||||
} );
|
||||
} )
|
||||
.promise( { abort: xhr.abort } );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue