You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2022/02/09 03:06:16 UTC

[royale-asjs] branch develop updated: Trying this to resolve issues with setting a new Popup's parent in PopUpManager.addPopup as an existing popup (null reference errors) (Does not seem to cause problems in an app that has extensive use of PopUps, but feedback welcome.)

This is an automated email from the ASF dual-hosted git repository.

gregdove 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 e519d71  Trying this to resolve issues with setting a new Popup's parent in PopUpManager.addPopup as an existing popup (null reference errors) (Does not seem to cause problems in an app that has extensive use of PopUps, but feedback welcome.)
e519d71 is described below

commit e519d718107f8a631a03da7fb1dfa0d88a945ef4
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Feb 9 16:06:06 2022 +1300

    Trying this to resolve issues with setting a new Popup's parent in PopUpManager.addPopup as an existing popup (null reference errors)
    (Does not seem to cause problems in an app that has extensive use of PopUps, but feedback welcome.)
---
 .../MXRoyale/src/main/royale/mx/managers/PopUpManagerModal.as        | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/PopUpManagerModal.as b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/PopUpManagerModal.as
index 5597709..d1e265b 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/PopUpManagerModal.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/PopUpManagerModal.as
@@ -18,6 +18,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package mx.managers
 {
+  import org.apache.royale.core.IPopUpHost;
   import org.apache.royale.core.IUIBase;
   import org.apache.royale.core.IParent;
   import org.apache.royale.events.MouseEvent;
@@ -49,7 +50,7 @@ package mx.managers
      */
     public static function show(host:IUIBase, forPopup:IFlexDisplayObject):void
     {
-      var hostParent:IParent = host.parent;
+      var hostParent:IParent = host is IPopUpHost ? IPopUpHost(host).popUpParent : host.parent;
       var overlay:PopUpManagerModal = new PopUpManagerModal();
       COMPILE::SWF
       {
@@ -92,7 +93,7 @@ package mx.managers
 
     public static function remove(host:IUIBase, forPopup:IFlexDisplayObject):void
     {
-        var hostParent:IParent = host.parent;
+      var hostParent:IParent = host is IPopUpHost ? IPopUpHost(host).popUpParent : host.parent;
       var overlay:PopUpManagerModal ;
       COMPILE::SWF{
         overlay = overlaysByPopUp[forPopup];