]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes major rendering bug (collapsed tab sheet content) in IE. Bug was easily reprodu...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 10 Mar 2008 14:39:33 +0000 (14:39 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 10 Mar 2008 14:39:33 +0000 (14:39 +0000)
svn changeset:4013/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java

index dd4bd2b08e0af189f47340ded44122f8102b6271..53b0cf36ae0354453eebb730b8b7c5f40cca86ce 100644 (file)
@@ -9,6 +9,7 @@ import java.util.Iterator;
 
 import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.WindowResizeListener;
 import com.google.gwt.user.client.ui.RootPanel;
@@ -37,6 +38,12 @@ public class IView extends SimplePanel implements Paintable,
 
     private ShortcutActionHandler actionHandler;
 
+    private int width;
+
+    private int height;
+
+    private Timer resizeTimer;
+
     public IView(String elementId) {
         super();
         setStyleName(CLASSNAME);
@@ -155,11 +162,9 @@ public class IView extends SimplePanel implements Paintable,
             w.hide();
         }
 
-        if (true) {
-            // IE somehow fails some layout on first run, force layout
-            // functions
-            Util.runDescendentsLayout(this);
-        }
+        // IE somehow fails some layout on first run, force layout
+        // functions
+        Util.runDescendentsLayout(this);
 
     }
 
@@ -172,7 +177,41 @@ public class IView extends SimplePanel implements Paintable,
     }
 
     public void onWindowResized(int width, int height) {
-        Util.runDescendentsLayout(this);
+        if (Util.isIE()) {
+            if (resizeTimer == null) {
+                resizeTimer = new Timer() {
+                    public void run() {
+                        boolean changed = false;
+                        if (IView.this.width != getOffsetWidth()) {
+                            IView.this.width = getOffsetWidth();
+                            changed = true;
+                            ApplicationConnection.getConsole().log(
+                                    "window w" + IView.this.width);
+                        }
+                        if (IView.this.height != getOffsetHeight()) {
+                            IView.this.height = getOffsetHeight();
+                            changed = true;
+                            ApplicationConnection.getConsole().log(
+                                    "window h" + IView.this.height);
+                        }
+                        if (changed) {
+                            ApplicationConnection
+                                    .getConsole()
+                                    .log(
+                                            "Running layout functions due window resize");
+                            Util.runDescendentsLayout(IView.this);
+                        }
+                    }
+                };
+            } else {
+                resizeTimer.cancel();
+            }
+            resizeTimer.schedule(200);
+        } else {
+            ApplicationConnection.getConsole().log(
+                    "Running layout functions due window resize");
+            Util.runDescendentsLayout(this);
+        }
     }
 
     public native static void goTo(String url)