You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/10/29 19:16:18 UTC

[23/23] git commit: [flex-asjs] [refs/heads/develop] - save a layout pass and just hook up events

save a layout pass and just hook up events


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

Branch: refs/heads/develop
Commit: 9ec0bfa7bb159d95f389b3f4ac098eb279a23f9d
Parents: 9c90373
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 29 10:31:43 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Oct 29 11:15:45 2014 -0700

----------------------------------------------------------------------
 .../flex/html/beads/layouts/NonVirtualBasicLayout.as   | 13 ++++++++-----
 .../html/beads/layouts/NonVirtualHorizontalLayout.as   | 13 ++++++++-----
 .../html/beads/layouts/NonVirtualVerticalLayout.as     | 13 ++++++++-----
 3 files changed, 24 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9ec0bfa7/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
index 6a19204..521f177 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
@@ -77,9 +77,7 @@ package org.apache.flex.html.beads.layouts
             // initial sizing by the parent.
             if (host.isWidthSizedToContent() && host.isHeightSizedToContent())
             {
-                host.addEventListener("childrenAdded", changeHandler);
-                host.addEventListener("layoutNeeded", changeHandler);
-                host.addEventListener("itemsCreated", changeHandler);
+                addOtherListeners();
             }
             else
             {
@@ -87,15 +85,20 @@ package org.apache.flex.html.beads.layouts
                 host.addEventListener("widthChanged", changeHandler);
                 host.addEventListener("sizeChanged", sizeChangeHandler);
                 if (!isNaN(host.explicitWidth) && !isNaN(host.explicitHeight))
-                    sizeChangeHandler(null);
+                    addOtherListeners();
             }
 		}
 	
-        private function sizeChangeHandler(event:Event):void
+        private function addOtherListeners():void
         {
             host.addEventListener("childrenAdded", changeHandler);
             host.addEventListener("layoutNeeded", changeHandler);
             host.addEventListener("itemsCreated", changeHandler);
+        }
+        
+        private function sizeChangeHandler(event:Event):void
+        {
+            addOtherListeners();
             changeHandler(event);
         }
         

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9ec0bfa7/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
index c663d8f..c3540c1 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
@@ -76,9 +76,7 @@ package org.apache.flex.html.beads.layouts
             // initial sizing by the parent.
             if (host.isWidthSizedToContent() && host.isHeightSizedToContent())
             {
-                host.addEventListener("childrenAdded", changeHandler);
-                host.addEventListener("layoutNeeded", changeHandler);
-                host.addEventListener("itemsCreated", changeHandler);
+                addOtherListeners();
             }
             else
             {
@@ -86,15 +84,20 @@ package org.apache.flex.html.beads.layouts
                 host.addEventListener("heightChanged", changeHandler);
                 host.addEventListener("sizeChanged", sizeChangeHandler);
                 if (!isNaN(host.explicitWidth) && !isNaN(host.explicitHeight))
-                    sizeChangeHandler(null);
+                    addOtherListeners();
             }
 		}
 	
-        private function sizeChangeHandler(event:Event):void
+        private function addOtherListeners():void
         {
             host.addEventListener("childrenAdded", changeHandler);
             host.addEventListener("layoutNeeded", changeHandler);
             host.addEventListener("itemsCreated", changeHandler);
+        }
+        
+        private function sizeChangeHandler(event:Event):void
+        {
+            addOtherListeners();
             changeHandler(event);
         }
         

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9ec0bfa7/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
index 5b7e5d6..28a5955 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
@@ -77,9 +77,7 @@ package org.apache.flex.html.beads.layouts
             // initial sizing by the parent.
             if (host.isWidthSizedToContent() && host.isHeightSizedToContent())
             {
-                host.addEventListener("childrenAdded", changeHandler);
-                host.addEventListener("layoutNeeded", changeHandler);
-                host.addEventListener("itemsCreated", changeHandler);
+                addOtherListeners();
             }
             else
             {
@@ -87,15 +85,20 @@ package org.apache.flex.html.beads.layouts
                 host.addEventListener("heightChanged", changeHandler);
                 host.addEventListener("sizeChanged", sizeChangeHandler);
                 if (!isNaN(host.explicitWidth) && !isNaN(host.explicitHeight))
-                    sizeChangeHandler(null);
+                    addOtherListeners();
             }
 		}
 	
-        private function sizeChangeHandler(event:Event):void
+        private function addOtherListeners():void
         {
             host.addEventListener("childrenAdded", changeHandler);
             host.addEventListener("layoutNeeded", changeHandler);
             host.addEventListener("itemsCreated", changeHandler);
+        }
+        
+        private function sizeChangeHandler(event:Event):void
+        {
+            addOtherListeners();
             changeHandler(event);
         }