You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2016/12/19 02:17:51 UTC

[03/50] git commit: [flex-asjs] [refs/heads/feature/mdl] - Fix bug where initial selection messes up layout.

Fix bug where initial selection messes up layout.


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

Branch: refs/heads/feature/mdl
Commit: 650908713bc095cb06ecc9da81de1d9a31eaa87f
Parents: ff02086
Author: yishayw <yi...@hotmail.com>
Authored: Sun Dec 11 12:15:17 2016 +0200
Committer: yishayw <yi...@hotmail.com>
Committed: Sun Dec 11 12:15:17 2016 +0200

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/html/beads/AccordionView.as   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65090871/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AccordionView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AccordionView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AccordionView.as
index 0f733ac..c57aacf 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AccordionView.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AccordionView.as
@@ -19,11 +19,13 @@
 package org.apache.flex.html.beads
 {
 	import org.apache.flex.core.ILayoutChild;
+	import org.apache.flex.core.ISelectionModel;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.html.beads.layouts.IOneFlexibleChildLayout;
 	import org.apache.flex.html.supportClasses.ICollapsible;
+	import org.apache.flex.utils.StrandUtils;
 	
 	public class AccordionView extends ListView
 	{
@@ -61,8 +63,13 @@ package org.apache.flex.html.beads
 		
 		override protected function performLayout(event:Event):void
 		{
-			if (layout && layout.flexibleChild)
+			if (layout)
 			{
+				if (!layout.flexibleChild)
+				{
+					var model:ISelectionModel = StrandUtils.loadBead(ISelectionModel, "iBeadModel", host) as ISelectionModel;
+					layout.flexibleChild = (model.selectedItem as UIBase).id;
+				}
 				super.performLayout(event);
 			}
 		}