diff options
author | Antti Tanhuanpää <antti@vaadin.com> | 2014-05-06 16:39:15 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-05-09 09:13:56 +0000 |
commit | 1cf11f84320ef650b650eb8f852cee34e9e75c75 (patch) | |
tree | 1f5ad5f6ab722b70e400f83bc2a2cb6fcfd29700 /client | |
parent | 2ecdf7e517dffb17e90432b9d7bd7d42ad826c63 (diff) | |
download | vaadin-framework-1cf11f84320ef650b650eb8f852cee34e9e75c75.tar.gz vaadin-framework-1cf11f84320ef650b650eb8f852cee34e9e75c75.zip |
Resize PopupView's overlay on content resize (#13666)
Change-Id: Iad410f26ed7f20bb03f15c46673f6f18081261d9
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VPopupView.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ui/VPopupView.java b/client/src/com/vaadin/client/ui/VPopupView.java index 60165c9f9d..adf070f453 100644 --- a/client/src/com/vaadin/client/ui/VPopupView.java +++ b/client/src/com/vaadin/client/ui/VPopupView.java @@ -43,6 +43,7 @@ import com.vaadin.client.ComponentConnector; import com.vaadin.client.Util; import com.vaadin.client.VCaptionWrapper; import com.vaadin.client.VConsole; +import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; import com.vaadin.client.ui.popupview.VisibilityChangeEvent; import com.vaadin.client.ui.popupview.VisibilityChangeHandler; @@ -193,7 +194,8 @@ public class VPopupView extends HTML implements Iterable<Widget> { * (other than it being a VOverlay) is to be considered private and * potentially subject to change. */ - public class CustomPopup extends VOverlay { + public class CustomPopup extends VOverlay implements + StateChangeEvent.StateChangeHandler { private ComponentConnector popupComponentConnector = null; @@ -333,7 +335,9 @@ public class VPopupView extends HTML implements Iterable<Widget> { @Override public boolean remove(Widget w) { - + if (popupComponentConnector != null) { + popupComponentConnector.removeStateChangeHandler(this); + } popupComponentConnector = null; popupComponentWidget = null; captionWrapper = null; @@ -344,10 +348,15 @@ public class VPopupView extends HTML implements Iterable<Widget> { public void setPopupConnector(ComponentConnector newPopupComponent) { if (newPopupComponent != popupComponentConnector) { + if (popupComponentConnector != null) { + popupComponentConnector.removeStateChangeHandler(this); + } Widget newWidget = newPopupComponent.getWidget(); setWidget(newWidget); popupComponentWidget = newWidget; popupComponentConnector = newPopupComponent; + popupComponentConnector.addStateChangeHandler("height", this); + popupComponentConnector.addStateChangeHandler("width", this); } } @@ -361,6 +370,11 @@ public class VPopupView extends HTML implements Iterable<Widget> { return super.getContainerElement(); } + @Override + public void onStateChanged(StateChangeEvent stateChangeEvent) { + positionOrSizeUpdated(); + } + }// class CustomPopup public HandlerRegistration addVisibilityChangeHandler( |