flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [18/50] [abbrv] git commit: [flex-asjs] [refs/heads/core_js_to_as] - dismiss popup if click outside it. A later commit will detect clicks in the background areas not covered by controls
Date Thu, 08 Oct 2015 18:51:20 GMT
dismiss popup if click outside it.  A later commit will detect clicks in the background areas
not covered by controls


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

Branch: refs/heads/core_js_to_as
Commit: 6168c17d18ee507774f4f14d0f0dbd45d2fde30f
Parents: f2b1086
Author: Alex Harui <aharui@apache.org>
Authored: Mon Sep 14 11:49:39 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Sep 14 11:49:39 2015 -0700

----------------------------------------------------------------------
 .../html/beads/controllers/DropDownListController.as     | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6168c17d/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
index 17a4b64..29f58e1 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
@@ -25,6 +25,7 @@ package org.apache.flex.html.beads.controllers
 	import org.apache.flex.core.IBeadController;
 	import org.apache.flex.core.ISelectionModel;
 	import org.apache.flex.core.IStrand;
+    import org.apache.flex.core.IUIBase;
     import org.apache.flex.core.UIBase;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
@@ -89,6 +90,16 @@ package org.apache.flex.html.beads.controllers
 			DisplayObject(viewBead.popUp).x = pt.x;
 			DisplayObject(viewBead.popUp).y = pt.y;
             IEventDispatcher(viewBead.popUp).addEventListener("change", changeHandler);
+            IUIBase(_strand).topMostEventDispatcher.addEventListener("click", dismissHandler);
+        }
+        
+        private function dismissHandler(event:Event):void
+        {
+            if (event.target == _strand) return;
+            
+            IUIBase(_strand).topMostEventDispatcher.removeEventListener("click", dismissHandler);
+            var viewBead:IDropDownListView = _strand.getBeadByType(IDropDownListView) as
IDropDownListView;
+            viewBead.popUpVisible = false;
         }
         
         private function changeHandler(event:Event):void


Mime
View raw message