royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-asjs] 03/17: use popuphost correctly
Date Sat, 21 Jul 2018 06:28:11 GMT
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 14019432aef60cce480d5500145e3083e76ba7da
Author: Alex Harui <aharui@apache.org>
AuthorDate: Tue Jul 17 16:35:21 2018 -0700

    use popuphost correctly
---
 .../projects/Basic/src/main/royale/org/apache/royale/html/Menu.as | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/Menu.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/Menu.as
index 7681737..61fea69 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/Menu.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/Menu.as
@@ -20,7 +20,7 @@ package org.apache.royale.html
 {
 	import org.apache.royale.core.IMenu;
 	import org.apache.royale.core.IUIBase;
-	import org.apache.royale.core.UIBase;
+	import org.apache.royale.core.IParent;
 	import org.apache.royale.events.Event;
 	import org.apache.royale.events.IEventDispatcher;
 	import org.apache.royale.geom.Point;
@@ -148,7 +148,7 @@ package org.apache.royale.html
 		 */
 		public function show(component:IUIBase, xoffset:Number=0, yoffset:Number=0):void
 		{
-			var host:UIBase = UIUtils.findPopUpHost(component) as UIBase;
+			var host:IParent = UIUtils.findPopUpHost(component).popUpParent as IParent;
 			var orgPoint:Point = new Point(component.x+xoffset, component.y+yoffset);
 			var popupPoint:Point = PointUtils.localToGlobal(orgPoint, component.parent);
 			this.x = popupPoint.x;
@@ -167,8 +167,8 @@ package org.apache.royale.html
 		public function hide():void
 		{		
 			// dispatch the "hideMenus" event to trigger any exposed menu to be hidden.
-			var host:UIBase = UIUtils.findPopUpHost(this) as UIBase;
-			host.dispatchEvent(new Event("hideMenus"));
+			var host:IParent = UIUtils.findPopUpHost(this).popUpParent as IParent;
+			(host as IEventDispatcher).dispatchEvent(new Event("hideMenus"));
 		}
 	}
 }
\ No newline at end of file


Mime
View raw message