Fix broken NavigationTable.movePointerTo

Change-Id: If614a152be2250cd407d4ef5d360ff9d58f347fd
This commit is contained in:
Shawn Pearce
2013-07-08 23:19:59 -07:00
parent 5cb1dda445
commit a396d15834

View File

@@ -189,17 +189,14 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
}
protected void movePointerTo(final int newRow, final boolean scroll) {
if (getRowItem(newRow) == null) {
return;
}
final CellFormatter fmt = table.getCellFormatter();
final boolean clear = 0 <= currentRow && currentRow < table.getRowCount();
if (clear) {
final Element tr = DOM.getParent(fmt.getElement(currentRow, C_ARROW));
UIObject.setStyleName(tr, Gerrit.RESOURCES.css().activeRow(), false);
}
if (newRow >= 0) {
if (0 <= newRow && newRow < table.getRowCount()
&& getRowItem(newRow) != null) {
table.setWidget(newRow, C_ARROW, pointer);
final Element tr = DOM.getParent(fmt.getElement(newRow, C_ARROW));
UIObject.setStyleName(tr, Gerrit.RESOURCES.css().activeRow(), true);