aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Koivuviita <jouni.koivuviita@itmill.com>2008-09-10 10:24:59 +0000
committerJouni Koivuviita <jouni.koivuviita@itmill.com>2008-09-10 10:24:59 +0000
commit367e9f7c5af55b4cce9c4c30bd1c88256ff12490 (patch)
tree2c88b2cfbbf2d7105070617273f0f9565428ee3a /src
parent1b30ac91cfb6c0d728eeb689b95ea4a77776394d (diff)
downloadvaadin-framework-367e9f7c5af55b4cce9c4c30bd1c88256ff12490.tar.gz
vaadin-framework-367e9f7c5af55b4cce9c4c30bd1c88256ff12490.zip
Two "less than zero" checks added to prevent IE6 errors.
svn changeset:5377/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java
index ca2992c224..b15ae537ec 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java
@@ -73,6 +73,7 @@ public class IPanel extends SimplePanel implements Paintable,
DOM.sinkEvents(contentNode, Event.ONSCROLL);
}
+ @Override
protected Element getContainerElement() {
return contentNode;
}
@@ -245,6 +246,9 @@ public class IPanel extends SimplePanel implements Paintable,
"offsetWidth");
int borderWidthGuess = 200;
int widthGuess = captionOffsetWidth - borderWidthGuess;
+ if (widthGuess < 0) {
+ widthGuess = 0;
+ }
DOM.setStyleAttribute(contentNode, "width", widthGuess + "px");
int actualBorder = DOM.getElementPropertyInt(contentNode,
@@ -253,6 +257,9 @@ public class IPanel extends SimplePanel implements Paintable,
if (actualBorder != borderWidthGuess) {
int realWidthIncludingBorder = captionOffsetWidth
- actualBorder;
+ if (realWidthIncludingBorder < 0) {
+ realWidthIncludingBorder = 0;
+ }
DOM.setStyleAttribute(contentNode, "width",
realWidthIncludingBorder + "px");
}
@@ -335,6 +342,7 @@ public class IPanel extends SimplePanel implements Paintable,
Util.runDescendentsLayout(this);
}
+ @Override
public void onBrowserEvent(Event event) {
final Element target = DOM.eventGetTarget(event);
final int type = DOM.eventGetType(event);
@@ -380,6 +388,7 @@ public class IPanel extends SimplePanel implements Paintable,
/**
* Panel handles dimensions by itself.
*/
+ @Override
public void setHeight(String height) {
// NOP
}
@@ -387,6 +396,7 @@ public class IPanel extends SimplePanel implements Paintable,
/**
* Panel handles dimensions by itself.
*/
+ @Override
public void setWidth(String width) {
this.width = width;
// Let browser handle 100% width (DIV element takes all size by