Fix the bouncing effect when opening the sign in dialog

The sign in dialog calls onResize during its constructor, which
winds up where in AutoCenterDialogBox.center().  When center()
gets called on an unattached dialog, it attaches it to the UI,
causing it to show earlier than we wanted it to.

By only recentering the dialogs when they are actually attached
to the browser DOM we avoid the bouncing problem, as the dialog
doesn't display early.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-01-10 07:49:33 -08:00
parent 6ac17c5aa2
commit 3a6cdce26d

View File

@@ -56,6 +56,8 @@ public class AutoCenterDialogBox extends DialogBox {
}
protected void onResize(final int width, final int height) {
center();
if (isAttached()) {
center();
}
}
}