From c0e9e16c3fe44b7ed555ac6a5681d8df9d45b0e2 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Tue, 27 Oct 2009 15:38:05 +0000 Subject: [PATCH] merged [9413],[9414] from 6.1 svn changeset:9415/svn branch:6.2 --- .../terminal/gwt/client/ui/VEmbedded.java | 13 ++++++--- src/com/vaadin/ui/LoginForm.java | 27 +++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java b/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java index 52529ed468..c05f1c06d3 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java @@ -16,6 +16,7 @@ import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.HTML; import com.vaadin.terminal.gwt.client.ApplicationConnection; +import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.Paintable; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; @@ -214,10 +215,14 @@ public class VEmbedded extends HTML implements Paintable { @Override protected void onDetach() { - // Force browser to fire unload event when component is detached from - // the view (IE doesn't do this automatically) - if (browserElement != null) { - DOM.setElementAttribute(browserElement, "src", "javascript:false"); + if (BrowserInfo.get().isIE()) { + // Force browser to fire unload event when component is detached + // from + // the view (IE doesn't do this automatically) + if (browserElement != null) { + DOM.setElementAttribute(browserElement, "src", + "javascript:false"); + } } super.onDetach(); } diff --git a/src/com/vaadin/ui/LoginForm.java b/src/com/vaadin/ui/LoginForm.java index 53035083ef..33ee670f4b 100644 --- a/src/com/vaadin/ui/LoginForm.java +++ b/src/com/vaadin/ui/LoginForm.java @@ -243,6 +243,9 @@ public class LoginForm extends CustomComponent { private static final Method ON_LOGIN_METHOD; + private static final String UNDEFINED_HEIGHT = "140px"; + private static final String UNDEFINED_WIDTH = "200px"; + static { try { ON_LOGIN_METHOD = LoginListener.class.getDeclaredMethod("onLogin", @@ -272,4 +275,28 @@ public class LoginForm extends CustomComponent { removeListener(LoginEvent.class, listener, ON_LOGIN_METHOD); } + @Override + public void setWidth(float width, int unit) { + super.setWidth(width, unit); + if (iframe != null) { + if (width < 0) { + iframe.setWidth(UNDEFINED_WIDTH); + } else { + iframe.setWidth("100%"); + } + } + } + + @Override + public void setHeight(float height, int unit) { + super.setHeight(height, unit); + if (iframe != null) { + if (height < 0) { + iframe.setHeight(UNDEFINED_HEIGHT); + } else { + iframe.setHeight("100%"); + } + } + } + } -- 2.39.5