This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 05dd255 alert shown in close handler was going up before the
controller removed the first alert. Should fix #812
05dd255 is described below
commit 05dd2557b12e7fd02ed6a14f864d2cbcd1b889f9
Author: Alex Harui <[email protected]>
AuthorDate: Wed May 13 00:37:00 2020 -0700
alert shown in close handler was going up before the controller removed the
first alert. Should fix #812
---
.../projects/MXRoyale/src/main/royale/mx/controls/Alert.as | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Alert.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Alert.as
index bfe46f0..62ecdcb 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Alert.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Alert.as
@@ -30,8 +30,8 @@ package mx.controls
import org.apache.royale.core.IAlertModel;
import org.apache.royale.core.IChild;
import org.apache.royale.events.CloseEvent;
- import org.apache.royale.events.Event;
-
+ import org.apache.royale.events.Event;
+
/*
import flash.events.Event;
import flash.events.EventPhase;
@@ -502,9 +502,6 @@ public class Alert extends Panel
alert.title = title;
//alert.iconClass = iconClass;
- if (closeHandler != null)
- alert.addEventListener(CloseEvent.CLOSE, closeHandler);
-
// Setting a module factory allows the correct embedded font to be
found.
/*if (moduleFactory)
alert.moduleFactory = moduleFactory;
@@ -528,6 +525,11 @@ public class Alert extends Panel
PopUpManager.addPopUp(alert, parent, true);
+ // let the controller that gets added during addPopUp to get
the event first
+
+ if (closeHandler != null)
+ alert.addEventListener(CloseEvent.CLOSE, closeHandler);
+
return alert;
}