From: Leif Åstrand Date: Thu, 23 Feb 2012 10:54:15 +0000 (+0200) Subject: Run insert to update index even if already attached (#8313) X-Git-Tag: 7.0.0.alpha2~434^2~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ce42589a195a43d2a3a0a79e57a54f585000ca0d;p=vaadin-framework.git Run insert to update index even if already attached (#8313) --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayout.java index ca8b1ebc8d..3c0e9af26d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayout.java @@ -39,14 +39,9 @@ public class VMeasuringOrderedLayout extends ComplexPanel { Element containerElement = getElement(); Node childAtIndex = containerElement.getChild(index); - boolean alreadyAttached; if (childAtIndex != wrapperElement) { - alreadyAttached = wrapperElement.getParentElement() == containerElement; + // Insert at correct location not attached or at wrong location containerElement.insertBefore(wrapperElement, childAtIndex); - } else { - alreadyAttached = true; - } - if (!alreadyAttached) { insert(widget, wrapperElement, index, false); }