flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [2/3] git commit: [flex-asjs] [refs/heads/develop] - have deferred content request a layout. Seems like a common enough case to bake in
Date Thu, 21 May 2015 17:45:10 GMT
have deferred content request a layout.  Seems like a common enough case to bake in


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/ce954097
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ce954097
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ce954097

Branch: refs/heads/develop
Commit: ce95409790fa3f39ac5eef297aac8c8e2eb5e582
Parents: 0bdfe80
Author: Alex Harui <aharui@apache.org>
Authored: Tue May 19 13:01:34 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu May 21 10:44:50 2015 -0700

----------------------------------------------------------------------
 .../as/src/org/apache/flex/html/beads/ImageButtonView.as    | 9 +++++++++
 .../HTML/as/src/org/apache/flex/html/beads/ImageView.as     | 8 ++++++++
 .../apache/flex/html/supportClasses/ContainerContentArea.as | 8 ++++++++
 3 files changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ce954097/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageButtonView.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageButtonView.as
index 7210967..972c1de 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageButtonView.as
@@ -32,6 +32,7 @@ package org.apache.flex.html.beads
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.UIButtonBase;
     import org.apache.flex.core.ValuesManager;
+    import org.apache.flex.events.Event;
 	
 	/**
 	 *  The ImageButtonView class provides an image-only view
@@ -111,12 +112,20 @@ package org.apache.flex.html.beads
 				loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void
{ 
                     var host:UIButtonBase = UIButtonBase(_strand);
                     if (isNaN(host.explicitWidth) && isNaN(host.percentWidth))
+                    {
                         host.setWidth(loader.content.width);
+                        if (host.parent)
+                            host.parent.dispatchEvent(new org.apache.flex.events.Event("layoutNeeded"));
+                    }
                     else
                         loader.content.width = host.width;
                     
                     if (isNaN(host.explicitHeight) && isNaN(host.percentHeight))
+                    {
                         host.setHeight(loader.content.height);
+                        if (host.parent)
+                            host.parent.dispatchEvent(new org.apache.flex.events.Event("layoutNeeded"));
+                    }
                     else
                         loader.content.height = host.height;
                     updateHitArea();

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ce954097/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageView.as
index 95ed077..8f66596 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageView.as
@@ -111,12 +111,20 @@ package org.apache.flex.html.beads
 			host.addChild(bitmap);
 			
             if (host.isWidthSizedToContent())
+            {
                 host.dispatchEvent(new Event("widthChanged"));
+                if (host.parent)
+                    host.parent.dispatchEvent(new Event("layoutNeeded"));
+            }
             else
                 bitmap.width = UIBase(_strand).width;
                 
             if (host.isHeightSizedToContent())
+            {
                 host.dispatchEvent(new Event("heightChanged"));
+                if (host.parent)
+                    host.parent.dispatchEvent(new Event("layoutNeeded"));
+            }
             else
                 bitmap.height = UIBase(_strand).height;
                 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ce954097/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ContainerContentArea.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ContainerContentArea.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ContainerContentArea.as
index 1095ad2..95b507c 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ContainerContentArea.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ContainerContentArea.as
@@ -19,6 +19,7 @@
 package org.apache.flex.html.supportClasses
 {
 	import org.apache.flex.core.UIBase;
+    import org.apache.flex.events.Event;
 	
     /**
      *  The ContainerContentArea class implements the actualParent for
@@ -43,6 +44,13 @@ package org.apache.flex.html.supportClasses
 		public function ContainerContentArea()
 		{
 			super();
+            addEventListener("layoutNeeded", forwardEventHandler);
 		}
+        
+        private function forwardEventHandler(event:Event):void
+        {
+            if (parent)
+                parent.dispatchEvent(event);
+        }
 	}
 }


Mime
View raw message