royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yish...@apache.org
Subject [royale-asjs] branch EventConverter updated: Fixes #128
Date Wed, 14 Mar 2018 16:16:19 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/EventConverter by this push:
     new c008696  Fixes #128
c008696 is described below

commit c00869695515799e0658fd4f53c9192aae41850d
Author: DESKTOP-RH4S838\Yishay <yishayjobs@hotmail.com>
AuthorDate: Wed Mar 14 18:16:08 2018 +0200

    Fixes #128
---
 .../org/apache/royale/core/HTMLElementWrapper.as   | 23 +++++++++++-----------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
index 7228fbc..7aa8a0b 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
@@ -71,18 +71,17 @@ package org.apache.royale.core
 		{
             var e:IBrowserEvent;
             var nativeEvent:Object = eventObject.getBrowserEvent();
-            switch(nativeEvent.constructor.name)
-            {
-                case "KeyboardEvent":
-                    e = KeyboardEventConverter.convert(nativeEvent);
-                    break;
-                case "MouseEvent":
-                    e = MouseEventConverter.convert(nativeEvent);
-                    break;
-                default:
-                    e = new org.apache.royale.events.BrowserEvent();
-                    break;
-            }
+			var constructorName:String = nativeEvent.constructor.toString();
+			if (constructorName.indexOf('KeyboardEvent') > -1)
+			{
+				e = KeyboardEventConverter.convert(nativeEvent);
+			} else if (constructorName.indexOf('MouseEvent') > -1)
+			{
+				e = MouseEventConverter.convert(nativeEvent);
+			} else
+			{
+				e = new org.apache.royale.events.BrowserEvent();
+			}
 
 			e.wrapEvent(eventObject);
 			return HTMLElementWrapper.googFireListener(listener, e);

-- 
To stop receiving notification emails like this one, please contact
yishayw@apache.org.

Mime
View raw message