This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
     new c613581ed4 MX ToolTipBead: Add MouseEvent.CLICK to handle removal of 
tooltip
c613581ed4 is described below

commit c613581ed4ade57f604cb2abd3f9ebc423449a56
Author: Piotr Zarzycki <[email protected]>
AuthorDate: Tue Apr 5 11:13:46 2022 +0200

    MX ToolTipBead: Add MouseEvent.CLICK to handle removal of tooltip
    
    - In some circumstances MouseEvent.MOUSE_DOWN is not enough - this is very 
edge case where for some reason MOUSE_DOWN is not triggered - the consideration 
is to remove completely MOUSE_DOWN in favour of CLICK
    - Remove some unused vars in Basic ToolTipBead
---
 .../apache/royale/html/accessories/ToolTipBead.as  |  2 --
 .../main/royale/mx/controls/beads/ToolTipBead.as   | 37 ++++++++--------------
 2 files changed, 14 insertions(+), 25 deletions(-)

diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/ToolTipBead.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/ToolTipBead.as
index 261bd3458a..919f976d79 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/ToolTipBead.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/ToolTipBead.as
@@ -169,7 +169,6 @@ package org.apache.royale.html.accessories
                        var xFactor:Number = 1;
                        var yFactor:Number = 1;
                        var pt:Point;
-                       var relative:Boolean = _xPos > TOP &&  _yPos > TOP;
 
                        if (_xPos == LEFT) {
                                xFactor = Number.POSITIVE_INFINITY;
@@ -210,7 +209,6 @@ package org.apache.royale.html.accessories
                {
                        (_strand as 
IEventDispatcher).removeEventListener(MouseEvent.MOUSE_OUT, rollOutHandler, 
false);
 
-                       var comp:IUIBase = _strand as IUIBase;
                        if (tt) {
                                host.popUpParent.removeElement(tt);
                                tt = null;
diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/ToolTipBead.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/ToolTipBead.as
index ab3f4fa7fa..f48312ddc7 100644
--- 
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/ToolTipBead.as
+++ 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/ToolTipBead.as
@@ -36,30 +36,9 @@ package mx.controls.beads
                {
                        super();
                }
-               
-               /**                             
-                *  @copy org.apache.royale.core.IBead#strand
-                *
-                *  @langversion 3.0
-                *  @playerversion Flash 10.2
-                *  @playerversion AIR 2.6
-                *  @productversion Royale 0.0
-                */
-               override public function set strand(value:IStrand):void
-               {
-                       super.strand = value;
-                       
IEventDispatcher(value).addEventListener(MouseEvent.MOUSE_DOWN, 
mouseDownHandler, false);
-               }
-               
-               /**
-                * @private
-                */
-               private function mouseDownHandler(event:MouseEvent):void
-               {
-                       super.rollOutHandler(event);
-               }
-        
+
         private var _isError:Boolean;
+
         public function get isError():Boolean
         {
             return _isError;    
@@ -72,6 +51,10 @@ package mx.controls.beads
         override protected function rollOverHandler(event:MouseEvent):void
         {
             super.rollOverHandler(event);
+
+                       listenOnStrand(MouseEvent.MOUSE_DOWN, rollOutHandler);
+                       listenOnStrand(MouseEvent.CLICK, rollOutHandler);
+
             COMPILE::JS
             {
                 if (tt)
@@ -82,6 +65,14 @@ package mx.controls.beads
             }
         }
 
+               override public function removeTip():void
+               {
+                       super.removeTip();
+
+                       listenOnStrand(MouseEvent.MOUSE_DOWN, rollOutHandler, 
false, true);
+                       listenOnStrand(MouseEvent.CLICK, rollOutHandler, false, 
true);
+               }
+
                COMPILE::JS
                private function adjustInsideBoundsIfNecessary():void{ //could 
override determinePosition instead
                        var screen:Rectangle = 
((FlexGlobals.topLevelApplication as UIComponent).systemManager as 
SystemManager).screen;

Reply via email to