summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/LoginForm.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/vaadin/ui/LoginForm.java')
-rw-r--r--src/com/vaadin/ui/LoginForm.java27
1 files changed, 27 insertions, 0 deletions
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%");
+ }
+ }
+ }
+
}