Provide default highlighting of simple active LinkMenuItems

When the Screen displayed matches the Screen which a menu item
would lead to, highlight the active menu (similar to an
active table row).  This highlighting covers most of the
simplest cases but does not handle more complex situations
like the Differences menus, those will be handled in a
follow on change.

Change-Id: I6470abd7a544adf21ad143fda5da57cddad126e1
This commit is contained in:
Martin Fick
2012-12-04 13:48:19 -07:00
committed by Gerrit Code Review
parent fdc62b4c0a
commit 041bfbcdd0
2 changed files with 8 additions and 0 deletions

View File

@@ -33,5 +33,10 @@ public class LinkMenuItem extends InlineHyperlink implements ScreenLoadHandler {
}
public void onScreenLoad(ScreenLoadEvent event) {
if (event.getScreen().getToken().equals(getTargetHistoryToken())){
addStyleName(Gerrit.RESOURCES.css().activeRow());
} else {
removeStyleName(Gerrit.RESOURCES.css().activeRow());
}
}
}