royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com.INVALID>
Subject Re: [royale-asjs] branch develop updated: I think this fixes Menu
Date Thu, 13 Sep 2018 15:54:18 GMT
Is setTimeout guaranteed to run after the CLICK event?

´╗┐On 9/13/18, 6:14 AM, "harbs@apache.org" <harbs@apache.org> wrote:

    This is an automated email from the ASF dual-hosted git repository.
    
    harbs pushed a commit to branch develop
    in repository https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C1ae20fcfaca24ad2792f08d6197acee6%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636724412586134726&amp;sdata=gasHWKJBGUaGc6k7gqt2fJcI3iQ2qp4Xjjst7SA7a%2FE%3D&amp;reserved=0
    
    
    The following commit(s) were added to refs/heads/develop by this push:
         new e1ec25e  I think this fixes Menu
    e1ec25e is described below
    
    commit e1ec25e0d8b1e59bfbb1e3d0cf856fe9dfb4dc5e
    Author: Harbs <harbs@in-tools.com>
    AuthorDate: Thu Sep 13 16:14:03 2018 +0300
    
        I think this fixes Menu
    ---
     .../projects/Basic/src/main/resources/defaults.css |  1 +
     .../controllers/ItemRendererMouseController.as     |  1 -
     .../controllers/MenuSelectionMouseController.as    | 33 ++++++++++++++--------
     3 files changed, 23 insertions(+), 12 deletions(-)
    
    diff --git a/frameworks/projects/Basic/src/main/resources/defaults.css b/frameworks/projects/Basic/src/main/resources/defaults.css
    index f88da20..15cb4e6 100644
    --- a/frameworks/projects/Basic/src/main/resources/defaults.css
    +++ b/frameworks/projects/Basic/src/main/resources/defaults.css
    @@ -545,6 +545,7 @@ Panel
     	IBeadModel: ClassReference("org.apache.royale.html.beads.models.PanelModel");
     	IBeadView: ClassReference("org.apache.royale.html.beads.PanelView");
     	IPanelLayout: ClassReference("org.apache.royale.html.beads.layouts.VerticalFlexLayout");
    +	IPanelContentArea: ClassReference("org.apache.royale.html.Container");
     	
     	background-color: #FFFFFF;
     	border: 1px solid #333333
    diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
    index f408a71..6073264 100644
    --- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
    +++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
    @@ -92,7 +92,6 @@ COMPILE::JS {
     				goog.events.listen(element, goog.events.EventType.MOUSEOUT, this.handleMouseOut);
     				goog.events.listen(element, goog.events.EventType.MOUSEDOWN, this.handleMouseDown);
     				goog.events.listen(element, goog.events.EventType.CLICK, this.handleMouseUp);
    -                goog.events.listen(element, goog.events.EventType.MOUSEUP, this.handleMouseUp);
     			}
     		}
     		
    diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as
    index 5f986bb..6a09a52 100644
    --- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as
    +++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as
    @@ -127,6 +127,8 @@ package org.apache.royale.html.beads.controllers
     		 *  @playerversion Flash 10.2
     		 *  @playerversion AIR 2.6
     		 *  @productversion Royale 0.9
    +         *  @royaleignorecoercion org.apache.royale.core.UIBase
    +         *  @royaleignorecoercion org.apache.royale.core.IUIBase
     		 */
     		protected function hideOpenMenus():void
     		{
    @@ -137,8 +139,9 @@ package org.apache.royale.html.beads.controllers
     				if (menu.parent != null) {
     					var controller:MenuSelectionMouseController = menu.getBeadByType(MenuSelectionMouseController)
as MenuSelectionMouseController;
     					controller.removeClickOutHandler(menu);
    -                    var host:IPopUpHost = UIUtils.findPopUpHost(_strand as IUIBase);
    -					host.popUpParent.removeElement(menu);
    +                    var host:IPopUpHost = UIUtils.findPopUpHost(menu as IUIBase);
    +					if(host)
    +						host.popUpParent.removeElement(menu);
     				}
     			}
     			MenuModel.clearMenuList();
    @@ -163,6 +166,8 @@ package org.apache.royale.html.beads.controllers
     		 *  @playerversion Flash 10.2
     		 *  @playerversion AIR 2.6
     		 *  @productversion Royale 0.9
    +         *  @royaleignorecoercion org.apache.royale.core.IUIBase
    +         *  @royaleignorecoercion org.apache.royale.events.IEventDispatcher
     		 */
     		public function removeClickOutHandler(menu:Object):void
     		{
    @@ -191,23 +196,29 @@ package org.apache.royale.html.beads.controllers
     
     		/**
              * @royaleignorecoercion HTMLElement
    +		 * @royaleignorecoercion org.apache.royale.core.IUIBase
     		 * @private
     		 */
     		COMPILE::JS
     		protected function hideMenu_internal(event:BrowserEvent):void
     		{			
                 var menu:IMenu = _strand as IMenu;
    +			var menuElem:HTMLElement = (_strand as IUIBase).element as HTMLElement;
    +			var menuBarElement:HTMLElement;
                 if (menu.parentMenuBar)
                 {
    -                var menuBarElement:HTMLElement = (menu.parentMenuBar as IUIBase).element
as HTMLElement;
    -                var target:HTMLElement = event.target as HTMLElement;
    -                while (target != null)
    -                {
    -                    if (target == menuBarElement) return;
    -                    target = target.parentNode as HTMLElement;
    -                }
    -            }
    -			hideOpenMenus();
    +                menuBarElement = (menu.parentMenuBar as IUIBase).element as HTMLElement;
    +			}
    +			var target:HTMLElement = event.target as HTMLElement;
    +			while (target != null)
    +			{
    +				var comp:IUIBase = target["royale_wrapper"];
    +				if(comp && (comp is IMenu || comp == menu.parentMenuBar) ) return;
    +				// if (target == menuElem || (menuBarElement && target == menuBarElement)
) return;
    +				target = target.parentNode as HTMLElement;
    +			}
    +            
    +			setTimeout(hideOpenMenus);
     		}
     	}
     }
    \ No newline at end of file
    
    

Mime
View raw message