flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject [1/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34088 Don't close when selecting something from a DropDownList + cleaned up code a little
Date Tue, 18 Feb 2014 22:06:46 GMT
Repository: flex-sdk
Updated Branches:
  refs/heads/develop 0949d97d0 -> 6e46938f6


FLEX-34088 Don't close when selecting something from a DropDownList + cleaned up code a little


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

Branch: refs/heads/develop
Commit: 765c12a99184332a7000d27d66d5ad4b6cfc5dd3
Parents: 3c4efbb
Author: Justin Mclean <jmclean@apache.org>
Authored: Wed Feb 19 09:01:06 2014 +1100
Committer: Justin Mclean <jmclean@apache.org>
Committed: Wed Feb 19 09:01:06 2014 +1100

----------------------------------------------------------------------
 .../components/supportClasses/DropDownController.as  | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/765c12a9/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
b/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
index dfe82ba..c076211 100644
--- a/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
+++ b/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
@@ -30,11 +30,13 @@ import flash.events.TimerEvent;
 import flash.ui.Keyboard;
 import flash.utils.Timer;
 
+import mx.core.IUIComponent;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
 import mx.events.SandboxMouseEvent;
 import mx.managers.ISystemManager;
 
+import spark.components.DropDownList;
 import spark.events.DropDownEvent;
 
 use namespace mx_internal;
@@ -604,13 +606,18 @@ public class DropDownController extends EventDispatcher
             var target:DisplayObject = event.target as DisplayObject;
             if (openButton && target && openButton.contains(target))
                 return;
-            
+			
+			// don't close if something just been selected in a DropDownList
+			if (target is IUIComponent && (target as IUIComponent).document.hostComponent
is DropDownList)
+				return;	
+
             if (hitAreaAdditions != null)
             {
-                for (var i:int = 0;i<hitAreaAdditions.length;i++)
+				var length:int = hitAreaAdditions.length;
+                for (var i:int = 0;i < length; i++)
                 {
-                    if (hitAreaAdditions[i] == event.target ||
-                        ((hitAreaAdditions[i] is DisplayObjectContainer) && DisplayObjectContainer(hitAreaAdditions[i]).contains(event.target
as DisplayObject)))
+                    if (hitAreaAdditions[i] == target ||
+                        ((hitAreaAdditions[i] is DisplayObjectContainer) && DisplayObjectContainer(hitAreaAdditions[i]).contains(target)))
                         return;
                 }
             }


Mime
View raw message