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

commit e99789fc7fb0536b9ee13954cc19614337f66f7b
Author: Alex Harui <[email protected]>
AuthorDate: Tue Aug 13 16:03:44 2019 -0700

    try using visibility instead of display=none so that offsetParent and 
offsetWidth/Height evaluate to something
---
 .../src/main/royale/mx/core/UIComponent.as         | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index 484863e..fb1d8aa 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -5741,6 +5741,36 @@ COMPILE::JS
         super.removeEventListener(type, handler, opt_capture, 
opt_handlerScope);
     }
 
+    [Bindable("visibleChanged")]
+    COMPILE::JS
+    override public function get visible():Boolean
+    {
+        if (!positioner.style.visibility) return true;
+        
+        return positioner.style.visibility == 'visible';
+    }
+    
+    COMPILE::JS
+    override public function set visible(value:Boolean):void
+    {
+        var oldValue:Boolean = (!positioner.style.visibility) ||
+                                positioner.style.visibility == 'visible';
+        if (Boolean(value) !== oldValue)
+        {
+            if (!value) 
+            {
+                positioner.style.visibility = 'hidden';
+                dispatchEvent(new Event('hide'));
+            } 
+            else 
+            {
+                positioner.style.visibility = 'visible';
+                dispatchEvent(new Event('show'));
+            }
+            dispatchEvent(new Event('visibleChanged'));
+        }
+    }
+
 }
 
 }

Reply via email to