ChangeScreen2: Fix position of ReplyBox

Currently, ReplyBox is misplaced or even missing when the page is not
scrolled to the top.  Fix by scrolling the page to the top before
showing the PopupPanel.

Change-Id: Iea04ac40855a2588fc6eec9adca46fd11fcf937a
This commit is contained in:
Michael Zhou
2013-12-08 05:00:47 -05:00
committed by Shawn Pearce
parent da41bfe78a
commit f90bcdc7af
2 changed files with 2 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.event.logical.shared.CloseEvent;
import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwtexpui.globalkey.client.GlobalKey;
@@ -101,6 +102,7 @@ class ReplyAction {
}
});
p.add(replyBox);
Window.scrollTo(0, 0);
p.showRelativeTo(replyButton);
GlobalKey.dialog(p);
popup = p;

View File

@@ -49,7 +49,6 @@ import com.google.gwt.resources.client.CssResource;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
@@ -154,7 +153,6 @@ class ReplyBox extends Composite {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
Window.scrollTo(0, 0);
message.setFocus(true);
}});
Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {