nav.getElement().getStyle().setOpacity(1);
nav.getElement().getStyle().setDisplay(Display.BLOCK);
main.getElement().getStyle().clearLeft();
showNavHandler = nav.addDomHandler(new TransitionEndHandler() {
@Override
public void onTransitionEnd(TransitionEndEvent event) {
if (showNavHandler != null) {
showNavHandler.removeHandler();
showNavHandler = null;
}
}
}, TransitionEndEvent.getType());
} else {
CssUtil.setTransitionDuration(nav.getElement(), TRANSITION_TIME_IN_MS);
CssUtil.setTransitionDuration(main.getElement(), TRANSITION_TIME_IN_MS);
nav.getElement().getStyle().setOpacity(0);
main.getElement().getStyle().setLeft(0, Unit.PX);
hideNavHandler = nav.addDomHandler(new TransitionEndHandler() {
@Override
public void onTransitionEnd(TransitionEndEvent event) {
if (hideNavHandler != null) {
hideNavHandler.removeHandler();