*
* @param container
*/
- public static void runAncestorsLayout(HasWidgets container) {
+ public static void runDescendentsLayout(HasWidgets container) {
Iterator childWidgets = container.iterator();
while (childWidgets.hasNext()) {
Widget child = (Widget) childWidgets.next();
((ContainerResizedListener) child).iLayout();
} else if (child instanceof HasWidgets) {
HasWidgets childContainer = (HasWidgets) child;
- runAncestorsLayout(childContainer);
+ runDescendentsLayout(childContainer);
}
}
}
pixelPosition = DOM.getElementPropertyInt(splitter, "offsetTop");
// reposition splitter in case it is out of box
- int pixelSize = getSplitterSize();
if (pixelPosition > 0
&& pixelPosition + getSplitterSize() > wholeSize) {
pixelPosition = wholeSize - getSplitterSize();
break;
}
- Util.runAncestorsLayout(this);
+ Util.runDescendentsLayout(this);
}
private void setFirstWidget(Widget w) {
if (ITabsheet.this.client != null
&& ITabsheet.this.activeTabIndex != tabIndex) {
addStyleDependentName("loading");
- ITabsheet.this.tp.getWidget(
- ITabsheet.this.tp.getVisibleWidget()).setVisible(false);
+ // run updating variables in deferred command to bypass some FF
+ // optimization issues
DeferredCommand.addCommand(new Command() {
public void execute() {
+ ITabsheet.this.tp.getWidget(
+ ITabsheet.this.tp.getVisibleWidget())
+ .setVisible(false);
ITabsheet.this.client.updateVariable(ITabsheet.this.id,
"selected", ""
+ ITabsheet.this.tabKeys.get(tabIndex),
// Height calculations
if (h != null) {
- setHeight(h);
+ if (!h.equals(height))
+ setHeight(h);
} else {
this.height = null;
- this.tp.setHeight("auto");
- // We don't need overflow:auto when tabsheet height is not set
- // TODO reconsider, we might sometimes have wide, non-breaking
- // content
- DOM.setStyleAttribute(this.tp.getElement(), "overflow", "hidden");
+ this.tp.setHeight("");
}
// Render content
// Open selected tab
this.tb.selectTab(this.activeTabIndex);
- // tp.showWidget(activeTabIndex);
}
private void renderContent(final UIDL contentUIDL) {
DeferredCommand.addCommand(new Command() {
public void execute() {
- // Loading done, start drawing
Widget content = ITabsheet.this.client.getWidget(contentUIDL);
ITabsheet.this.tp.remove(ITabsheet.this.activeTabIndex);
ITabsheet.this.tp
((Paintable) content).updateFromUIDL(contentUIDL,
ITabsheet.this.client);
removeStyleDependentName("loading");
+ ITabsheet.this.iLayout();
}
});
+
}
private void clearTabs() {
this.tp.setHeight(neededHeight - pixelHeight + "px");
DOM.setStyleAttribute(this.tp.getElement(), "overflow", "");
}
- Util.runAncestorsLayout(this);
+ Util.runDescendentsLayout(this);
}
}