You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/05/06 18:47:33 UTC

git commit: [flex-asjs] [refs/heads/develop] - Fix event.target expressions by adding custom property to DOM dispatchers

Updated Branches:
  refs/heads/develop 059a9a66d -> d69ac2d3b


Fix event.target expressions by adding custom property to DOM dispatchers


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

Branch: refs/heads/develop
Commit: d69ac2d3bc22d3d0979053a9656ad7d495985801
Parents: 059a9a6
Author: Alex Harui <ah...@apache.org>
Authored: Mon May 6 09:45:51 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon May 6 09:47:24 2013 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/core/HTMLElementWrapper.js |   21 +++++++++++++++
 .../apache/flex/html/staticControls/CheckBox.js    |    1 +
 .../apache/flex/html/staticControls/ComboBox.js    |    2 +
 .../apache/flex/html/staticControls/RadioButton.js |    1 +
 .../apache/flex/html/staticControls/TextArea.js    |    1 +
 .../apache/flex/html/staticControls/TextButton.js  |    1 +
 .../apache/flex/html/staticControls/TextInput.js   |    1 +
 7 files changed, 28 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d69ac2d3/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js b/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
index a16bd18..ea3780a 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
@@ -148,3 +148,24 @@ org.apache.flex.core.HTMLElementWrapper.prototype.set_strand =
     this.strand = value;
   }
 };
+
+/**
+ Hack to allow event.target expressions to work
+ * @expose
+ * @this {Event}
+ * @return {Object} The wrapping object.
+ */
+Event.prototype.get_target = function() {
+  var obj = this.target.flexjs_wrapper;
+  return obj;
+};
+
+/**
+ Hack to allow event.target expressions to work
+ * @expose
+ * @this {goog.events.BrowserEvent}
+ * @return {Object} The wrapping object.
+ */
+goog.events.BrowserEvent.prototype.get_target = function() {
+  return this.event_.get_target();
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d69ac2d3/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
index e31ad1d..5142cb5 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
@@ -48,6 +48,7 @@ org.apache.flex.html.staticControls.CheckBox.prototype.addToParent =
   p.appendChild(this.element);
 
   this.positioner = this.element;
+  cb.flexjs_wrapper = this;
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d69ac2d3/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
index 445e810..c8469c2 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
@@ -68,6 +68,8 @@ org.apache.flex.html.staticControls.ComboBox.prototype.addToParent =
   // be visible
   goog.events.listen(p.parentElement, 'click',
       goog.bind(this.dismissPopup, this));
+
+  input.flexjs_wrapper = this;
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d69ac2d3/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
index 9cad80f..fb657b2 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
@@ -48,6 +48,7 @@ org.apache.flex.html.staticControls.RadioButton.prototype.addToParent =
   p.appendChild(this.element);
 
   this.positioner = this.element;
+  rb.flexjs_wrapper = this;
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d69ac2d3/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextArea.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextArea.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextArea.js
index 342ab25..162199b 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextArea.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextArea.js
@@ -41,6 +41,7 @@ org.apache.flex.html.staticControls.TextArea.prototype.addToParent =
   p.appendChild(this.element);
 
   this.positioner = this.element;
+  this.element.flexjs_wrapper = this;
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d69ac2d3/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
index 7479328..59fe22b 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
@@ -42,6 +42,7 @@ org.apache.flex.html.staticControls.TextButton.prototype.addToParent =
   p.appendChild(this.element);
 
   this.positioner = this.element;
+  this.element.flexjs_wrapper = this;
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d69ac2d3/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextInput.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextInput.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextInput.js
index f568e17..352a00e 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextInput.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextInput.js
@@ -42,6 +42,7 @@ org.apache.flex.html.staticControls.TextInput.prototype.addToParent =
   p.appendChild(this.element);
 
   this.positioner = this.element;
+  this.element.flexjs_wrapper = this;
 };