Repository: flex-asjs Updated Branches: refs/heads/develop 59afc8b91 -> b4e6ab687
JS side needed a kick to get top level object to begin its layout, just like its AS counterpart. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b4e6ab68 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b4e6ab68 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b4e6ab68 Branch: refs/heads/develop Commit: b4e6ab687484ebd3fd2efa790d77c45a55c976bf Parents: 59afc8b Author: Peter Ent <p...@apache.org> Authored: Fri Dec 18 14:23:48 2015 -0500 Committer: Peter Ent <p...@apache.org> Committed: Fri Dec 18 14:23:48 2015 -0500 ---------------------------------------------------------------------- .../as/src/org/apache/flex/core/Application.as | 23 +++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b4e6ab68/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as b/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as index bb2dff6..a5f299b 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as @@ -584,7 +584,28 @@ package org.apache.flex.core initialView.applicationModel = model; addElement(initialView); - dispatchEvent('viewChanged'); + if (initialView) + { + initialView.applicationModel = model; + // if someone has installed a resize listener, fake an event to run it now + if (initialView is ILayoutChild) + { + var ilc:ILayoutChild = initialView as ILayoutChild; + var useWidth:Number = document.width; + var useHeight:Number = document.height; + // otherwise, size once like this + if (!isNaN(ilc.percentWidth) && !isNaN(ilc.percentHeight)) { + ilc.setWidthAndHeight(useWidth, useHeight); + } + else if (!isNaN(ilc.percentWidth)) + ilc.setWidth(useWidth); + else if (!isNaN(ilc.percentHeight)) + ilc.setHeight(useHeight); + } + + dispatchEvent(new org.apache.flex.events.Event("viewChanged")); + } + dispatchEvent(new org.apache.flex.events.Event("applicationComplete")); }; }