flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [09/10] git commit: [flex-asjs] [refs/heads/develop] - watch for style changes
Date Sat, 10 Jan 2015 07:46:15 GMT
watch for style changes


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

Branch: refs/heads/develop
Commit: b4a0cfed6d8ce997fa38825ac1236b577346180a
Parents: b3c3133
Author: Alex Harui <aharui@apache.org>
Authored: Fri Jan 9 23:42:09 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Jan 9 23:45:58 2015 -0800

----------------------------------------------------------------------
 .../js/FlexJS/src/org/apache/flex/core/UIBase.js     | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b4a0cfed/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
index 3916d4e..dfb2323 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
@@ -24,6 +24,7 @@ goog.require('org.apache.flex.core.IParentIUIBase');
 goog.require('org.apache.flex.core.IStyleableObject');
 goog.require('org.apache.flex.core.IUIBase');
 goog.require('org.apache.flex.core.ValuesManager');
+goog.require('org.apache.flex.events.ValueChangeEvent');
 
 
 
@@ -781,6 +782,9 @@ org.apache.flex.core.UIBase.prototype.set_style = function(value) {
     if (typeof(value) == 'string')
       value = org.apache.flex.core.ValuesManager.valuesImpl.parseStyles(value);
     this.style_ = value;
+    if (value.addEventListener)
+      value.addEventListener(org.apache.flex.events.ValueChangeEvent.VALUE_CHANGE,
+          goog.bind(this.styleChangeHandler, this));
     this.dispatchEvent('stylesChanged');
   }
 };
@@ -788,6 +792,17 @@ org.apache.flex.core.UIBase.prototype.set_style = function(value) {
 
 /**
  * @expose
+ * @param {org.apache.flex.events.ValueChangeEvent} value The new style properties.
+ */
+org.apache.flex.core.UIBase.prototype.styleChangeHandler = function(value) {
+  var newStyle = {};
+  newStyle[value.propertyName] = value.newValue;
+  org.apache.flex.core.ValuesManager.valuesImpl.applyStyles(this, newStyle);
+};
+
+
+/**
+ * @expose
  * @return {boolean} True if visible.
  */
 org.apache.flex.core.UIBase.prototype.get_visible = function() {


Mime
View raw message