Revision: 9406
Author: jlaba...@google.com
Date: Fri Dec 10 10:51:39 2010
Log: 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.

Review at http://gwt-code-reviews.appspot.com/1210801

Review by: rchan...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=9406

Modified:
 /trunk/user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java

=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java Mon Nov 8 04:49:09 2010 +++ /trunk/user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java Fri Dec 10 10:51:39 2010
@@ -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

Reply via email to