Re-use internalList when building index

Calling #getItemNode on the un-initalised internalList caused
a tree rebuild of the sub-document.

On a page with 200 references this cuts the time it takes to
render the re-use list from ~2000ms to ~1000ms.

Bug: T134975
Change-Id: I696a965e88338e1bec2a14f61dab158c56728f2e
This commit is contained in:
Ed Sanders 2016-11-05 18:05:59 +00:00
parent f4eab9182a
commit 753d87b072

View file

@ -152,7 +152,7 @@ ve.ui.MWReferenceSearchWidget.prototype.buildIndex = function () {
n++;
refModel = ve.dm.MWReferenceModel.static.newFromReferenceNode( refNode );
view = new ve.ui.MWPreviewElement(
refModel.getDocument().getInternalList().getItemNode( refModel.getListIndex() )
this.internalList.getItemNode( refModel.getListIndex() )
);
refGroup = refModel.getGroup();