Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ABCB6180C7 for ; Thu, 8 Oct 2015 18:51:07 +0000 (UTC) Received: (qmail 87021 invoked by uid 500); 8 Oct 2015 18:51:04 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 86933 invoked by uid 500); 8 Oct 2015 18:51:04 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 86719 invoked by uid 99); 8 Oct 2015 18:51:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2015 18:51:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D7FB6E0C6F; Thu, 8 Oct 2015 18:51:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aharui@apache.org To: commits@flex.apache.org Date: Thu, 08 Oct 2015 18:51:20 -0000 Message-Id: <92b48a46b0804b889dfe054db6b0d28f@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer 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 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 Authored: Mon Sep 14 11:49:39 2015 -0700 Committer: Alex Harui 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