diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-03-10 14:39:33 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-03-10 14:39:33 +0000 |
commit | 06ab237750a8beebae886a89592885c78f6847dd (patch) | |
tree | 96d306be23641045a301bf4dd409e095b92089b4 | |
parent | fe5f671a3a85d4575605ae20ceb48ee93665627d (diff) | |
download | vaadin-framework-06ab237750a8beebae886a89592885c78f6847dd.tar.gz vaadin-framework-06ab237750a8beebae886a89592885c78f6847dd.zip |
Fixes major rendering bug (collapsed tab sheet content) in IE. Bug was easily reproducible in WH. Also a huge optimization.
svn changeset:4013/svn branch:trunk
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java index dd4bd2b08e..53b0cf36ae 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java @@ -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) |