flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [10/16] git commit: [flex-asjs] [refs/heads/develop] - listen for mouse events from the element
Date Mon, 05 Jan 2015 23:21:29 GMT
listen for mouse events from the element


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/71df7b13
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/71df7b13
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/71df7b13

Branch: refs/heads/develop
Commit: 71df7b13cbbd525eae49201ec814c7525c665be0
Parents: 73f9b83
Author: Alex Harui <aharui@apache.org>
Authored: Mon Jan 5 10:13:53 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Jan 5 15:21:01 2015 -0800

----------------------------------------------------------------------
 .../src/org/apache/flex/events/EventDispatcher.js    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/71df7b13/frameworks/js/FlexJS/src/org/apache/flex/events/EventDispatcher.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/events/EventDispatcher.js b/frameworks/js/FlexJS/src/org/apache/flex/events/EventDispatcher.js
index 24c4ae2..fd11a82 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/events/EventDispatcher.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/events/EventDispatcher.js
@@ -59,6 +59,9 @@ org.apache.flex.events.EventDispatcher.prototype.addEventListener =
       this.element.nodeName.toLowerCase() !== 'div' &&
       this.element.nodeName.toLowerCase() !== 'body') {
     source = this.element;
+  } else if (this.elementEvents[type]) {
+    // mouse and keyboard events also dispatch off the element.
+    source = this.element;
   }
 
   goog.events.listen(source, type, handler);
@@ -95,3 +98,15 @@ function(obj, propName, value) {
   }
 };
 
+
+/**
+ * @type {Object}
+ */
+org.apache.flex.events.EventDispatcher.prototype.elementEvents = {
+  mouseover: 1,
+  mouseout: 1,
+  mouseup: 1,
+  mousedown: 1,
+  mousemove: 1
+};
+


Mime
View raw message