Reviewers: rchandia,
Description:
Removing call to RootLayoutPanel#get() in SplitLayoutPanel so that it
does not force the creation of a RootLayoutPanel, which attaches itself
to the document body and blocks other elements attached to the
RootPanel. The new implenetation uses the max of the client size and the
scroll size, which is what PopupPanel does.
Please review this at http://gwt-code-reviews.appspot.com/1210801/show
Affected files:
M user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java
Index: user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java
===================================================================
--- user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java (revision
9374)
+++ user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java (working
copy)
@@ -23,6 +23,7 @@
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.Window;
/**
* A panel that adds user-positioned splitters between each of its child
@@ -109,9 +110,14 @@
case Event.ONMOUSEDOWN:
mouseDown = true;
- // Resize glassElem to take up the entire scrollable window area
- int height =
RootLayoutPanel.get().getElement().getScrollHeight() - 1;
- int width = RootLayoutPanel.get().getElement().getScrollWidth()
- 1;
+ /*
+ * Resize glassElem to take up the entire scrollable window area,
+ * which is the greater of the scroll size and the client size.
+ */
+ int width = Math.max(Window.getClientWidth(),
+ Document.get().getScrollWidth());
+ int height = Math.max(Window.getClientHeight(),
+ Document.get().getScrollHeight());
glassElem.getStyle().setHeight(height, Unit.PX);
glassElem.getStyle().setWidth(width, Unit.PX);
Document.get().getBody().appendChild(glassElem);
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors