summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2013-05-17 09:10:31 +0300
committerHenri Sara <hesara@vaadin.com>2013-05-17 09:10:31 +0300
commit145a3e3dad46e1aa04e4c8166e309ee8aaa8deeb (patch)
tree58b475a7224a6c932f77819b5c7a599749832499 /client
parentb79c0aa5bec3cf294dbc58ff66dbaa8686229654 (diff)
downloadvaadin-framework-145a3e3dad46e1aa04e4c8166e309ee8aaa8deeb.tar.gz
vaadin-framework-145a3e3dad46e1aa04e4c8166e309ee8aaa8deeb.zip
Send browser window resizes if there is a listener (#10055)
This also introduces PageState, which is at the moment a part of UIState. Change-Id: I4f927e6b8217fa789d83ce5e0d8254b141f485c7
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/ui/UIConnector.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/ui/UIConnector.java b/client/src/com/vaadin/client/ui/ui/UIConnector.java
index 079e133438..67cba1d3ea 100644
--- a/client/src/com/vaadin/client/ui/ui/UIConnector.java
+++ b/client/src/com/vaadin/client/ui/ui/UIConnector.java
@@ -68,6 +68,7 @@ import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
import com.vaadin.shared.ui.ui.PageClientRpc;
+import com.vaadin.shared.ui.ui.PageState;
import com.vaadin.shared.ui.ui.ScrollClientRpc;
import com.vaadin.shared.ui.ui.UIClientRpc;
import com.vaadin.shared.ui.ui.UIConstants;
@@ -138,7 +139,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector
getRpcProxy(UIServerRpc.class).resize(event.getHeight(),
event.getWidth(), Window.getClientWidth(),
Window.getClientHeight());
- if (getState().immediate) {
+ if (getState().immediate || getPageState().hasResizeListeners) {
getConnection().sendPendingVariableChanges();
}
}
@@ -504,6 +505,23 @@ public class UIConnector extends AbstractSingleComponentContainerConnector
return (UIState) super.getState();
}
+ /**
+ * Returns the state of the Page associated with the UI.
+ * <p>
+ * Note that state is considered an internal part of the connector. You
+ * should not rely on the state object outside of the connector who owns it.
+ * If you depend on the state of other connectors you should use their
+ * public API instead of their state object directly. The page state might
+ * not be an independent state object but can be embedded in UI state.
+ * </p>
+ *
+ * @since 7.1
+ * @return state object of the page
+ */
+ public PageState getPageState() {
+ return getState().pageState;
+ }
+
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) {
ComponentConnector oldChild = null;