Repository: flex-asjs Updated Branches: refs/heads/develop 86e2e9c60 -> cd207341b
DateField emits change event. Removing a pop-up needs to walk up the parent tree to find the IPopUpHost. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/cd207341 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/cd207341 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/cd207341 Branch: refs/heads/develop Commit: cd207341b6b9ad2753ea225eec7c6a5b6c6b84b6 Parents: 86e2e9c Author: Peter Ent <[email protected]> Authored: Fri Jul 31 11:25:47 2015 -0400 Committer: Peter Ent <[email protected]> Committed: Fri Jul 31 11:25:47 2015 -0400 ---------------------------------------------------------------------- .../projects/Core/as/src/org/apache/flex/utils/UIUtils.as | 9 ++++++--- .../HTML/asjs/src/org/apache/flex/html/DateField.as | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cd207341/frameworks/projects/Core/as/src/org/apache/flex/utils/UIUtils.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/UIUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/UIUtils.as index 5f81add..d76539c 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/UIUtils.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/UIUtils.as @@ -18,8 +18,8 @@ //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.utils { + import org.apache.flex.core.IChild; import org.apache.flex.core.IPopUpHost; - import org.apache.flex.core.IChild; import org.apache.flex.core.IUIBase; /** @@ -97,8 +97,11 @@ package org.apache.flex.utils */ public static function removePopUp(popUp:IChild):void { - var host:IPopUpHost = popUp.parent as IPopUpHost; - host.removeElement(popUp); + var start:IUIBase = popUp.parent as IUIBase; + while( start != null && !(start is IPopUpHost) && start is IChild ) { + start = IChild(start).parent as IUIBase; + } + (start as IPopUpHost).removeElement(popUp); } } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cd207341/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DateField.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DateField.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DateField.as index dfd2212..f46e453 100644 --- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DateField.as +++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DateField.as @@ -24,6 +24,11 @@ package org.apache.flex.html import org.apache.flex.core.ValuesManager; /** + * The change event is dispatched when the selectedDate is changed. + */ + [Event(name="change", type="org.apache.flex.events.Event")] + + /** * The DateField class provides an input field where a date can be entered * and a pop-up calendar control for picking a date as an alternative to * the text field.
