diff options
author | John Alhroos <john.ahlroos@itmill.com> | 2013-04-30 07:48:53 +0000 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2013-05-10 12:37:28 +0300 |
commit | ce9c818b8c1cd290747d841166008898187e7a58 (patch) | |
tree | 6983b13c4e280b6496ea1ea26071a999b7ddf239 | |
parent | 1b188073c46c5c21bb8ddeb21674452c9bc414fd (diff) | |
download | vaadin-framework-ce9c818b8c1cd290747d841166008898187e7a58.tar.gz vaadin-framework-ce9c818b8c1cd290747d841166008898187e7a58.zip |
Instead of applying workaround to the root panel, apply it to the sub window content element instead to prevent scrolling of the document when a sub window is removed. #11713 (#10776)
svn changeset:25899/svn branch:6.8
Change-Id: Ib3cb61e024ba461bcc146b9beb4a52cb6df9ce28
-rw-r--r-- | client/src/com/vaadin/client/ui/VWindow.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index fd2a701334..51a775cb7e 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/com/vaadin/client/ui/VWindow.java @@ -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. */ |