]> source.dussan.org Git - vaadin-framework.git/commitdiff
merged [9413],[9414] from 6.1
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 27 Oct 2009 15:38:05 +0000 (15:38 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 27 Oct 2009 15:38:05 +0000 (15:38 +0000)
svn changeset:9415/svn branch:6.2

src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java
src/com/vaadin/ui/LoginForm.java

index 52529ed468846bcf53a3451560ced22153ef2469..c05f1c06d32c099a0b7287a48fe9b9ca885aa557 100644 (file)
@@ -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();
     }
index 53035083ef897e27df2008ec727a8db1bb9e1aec..33ee670f4b49a0c3296919142b7cc07985c6e50d 100644 (file)
@@ -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%");
+            }
+        }
+    }
+
 }