Don't attempt to scroll NavigationTable until it is attached

Computing the scroll information for an unattached table is
useless. The UI state is not known and may be updated at a
later point in time.

This skips a bit of unnecessary work when a table is built
in the background, like FileTable does for ChangeScreen2.

Change-Id: I2892ae36a80f5158e30e019ebf9d6e865e348e93
This commit is contained in:
Shawn Pearce
2013-07-17 14:29:27 -07:00
parent 4b99298a4b
commit ebc13dc438

View File

@@ -200,7 +200,7 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
table.setWidget(newRow, C_ARROW, pointer);
final Element tr = DOM.getParent(fmt.getElement(newRow, C_ARROW));
UIObject.setStyleName(tr, Gerrit.RESOURCES.css().activeRow(), true);
if (scroll) {
if (scroll && isAttached()) {
scrollIntoView(tr);
}
} else if (clear) {