]> source.dussan.org Git - vaadin-framework.git/commitdiff
Instead of applying workaround to the root panel, apply it to the sub window content...
authorJohn Alhroos <john.ahlroos@itmill.com>
Tue, 30 Apr 2013 07:48:53 +0000 (07:48 +0000)
committerJohannes Dahlström <johannesd@vaadin.com>
Fri, 10 May 2013 09:37:28 +0000 (12:37 +0300)
svn changeset:25899/svn branch:6.8

Change-Id: Ib3cb61e024ba461bcc146b9beb4a52cb6df9ce28

client/src/com/vaadin/client/ui/VWindow.java

index fd2a7013340c710f5c878602701ed5d86a2be81f..51a775cb7e2717540f57568194ce18670d5a6eed 100644 (file)
@@ -419,14 +419,6 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
 
     @Override
     public void hide() {
-        if (vaadinModality) {
-            hideModalityCurtain();
-        }
-        super.hide();
-
-        // Remove window from windowOrder to avoid references being left
-        // hanging.
-        windowOrder.remove(this);
 
         /*
          * If the window has a RichTextArea and the RTA is focused at the time
@@ -443,20 +435,28 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
         if (BrowserInfo.get().isIE8()) {
             fixIE8FocusCaptureIssue();
         }
+
+        if (vaadinModality) {
+            hideModalityCurtain();
+        }
+        super.hide();
+
+        // Remove window from windowOrder to avoid references being left
+        // hanging.
+        windowOrder.remove(this);
     }
 
     private void fixIE8FocusCaptureIssue() {
         Element e = DOM.createInputText();
         Style elemStyle = e.getStyle();
         elemStyle.setPosition(Position.ABSOLUTE);
-        elemStyle.setLeft(-10, Unit.PX);
+        elemStyle.setTop(-10, Unit.PX);
         elemStyle.setWidth(0, Unit.PX);
         elemStyle.setHeight(0, Unit.PX);
 
-        Element rootPanel = RootPanel.getBodyElement();
-        rootPanel.appendChild(e);
+        contentPanel.getElement().appendChild(e);
         e.focus();
-        rootPanel.removeChild(e);
+        contentPanel.getElement().removeChild(e);
     }
 
     /** For internal use only. May be removed or replaced in the future. */