]> source.dussan.org Git - vaadin-framework.git/commitdiff
Run insert to update index even if already attached (#8313)
authorLeif Åstrand <leif@vaadin.com>
Thu, 23 Feb 2012 10:54:15 +0000 (12:54 +0200)
committerLeif Åstrand <leif@vaadin.com>
Thu, 23 Feb 2012 10:54:15 +0000 (12:54 +0200)
src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayout.java

index ca8b1ebc8d1c627d07c3389392c8cf3ac42b0e1d..3c0e9af26d754302ed9065cdd0337920950c42c7 100644 (file)
@@ -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);
         }