You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/07/21 06:28:25 UTC
[royale-asjs] 17/17: fix mouse events in mustella
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 cc768bc6096400bb254db35a5c332ef9ad2331cb
Author: Alex Harui <ah...@apache.org>
AuthorDate: Fri Jul 20 23:27:39 2018 -0700
fix mouse events in mustella
---
mustella/src/main/java/marmotinni/DispatchMouseEvent.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mustella/src/main/java/marmotinni/DispatchMouseEvent.java b/mustella/src/main/java/marmotinni/DispatchMouseEvent.java
index 82d3387..d8e26a9 100644
--- a/mustella/src/main/java/marmotinni/DispatchMouseEvent.java
+++ b/mustella/src/main/java/marmotinni/DispatchMouseEvent.java
@@ -32,7 +32,7 @@ import org.xml.sax.Attributes;
* Dispatch mouse event
*/
public class DispatchMouseEvent extends TestStep {
-
+
/**
* Dispatch a mouse event
*/
@@ -104,7 +104,7 @@ public class DispatchMouseEvent extends TestStep {
script = new StringBuilder();
script.append("var e = document.createEvent('MouseEvent');");
- script.append("e.initMouseEvent(\"" + type + "\", true, false, window, " + delta + ", " + x + ", " + y + ", " + localX + ", " + localY + ", " + ctrlKey + ", false, " + shiftKey + ", false, " + type.equals("mouseDown") + ", " + relatedObject + ");");
+ script.append("e.initMouseEvent(\"" + type.toLowerCase() + "\", true, false, window, " + delta + ", " + x + ", " + y + ", " + localX + ", " + localY + ", " + ctrlKey + ", false, " + shiftKey + ", false, " + type.equals("mouseDown") + ", " + relatedObject + ");");
script.append("document.getElementById('" + actualId + "').dispatchEvent(e);");
if (TestStep.showScripts)
System.out.println(script);