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 2015/01/12 19:50:55 UTC
[03/12] git commit: [flex-asjs] [refs/heads/develop] - handle
classname changes
handle classname 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/f4ff1dbf
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f4ff1dbf
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f4ff1dbf
Branch: refs/heads/develop
Commit: f4ff1dbfd42b1504c8179beb736897ade0ee5d5a
Parents: 155ebec
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jan 12 10:44:59 2015 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jan 12 10:44:59 2015 -0800
----------------------------------------------------------------------
.../FlexJSUI/src/org/apache/flex/core/CSSTextField.as | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f4ff1dbf/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/CSSTextField.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/CSSTextField.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/CSSTextField.as
index 16718c4..12248b8 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/CSSTextField.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/CSSTextField.as
@@ -23,6 +23,7 @@ package org.apache.flex.core
import flash.text.TextFormat;
import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
/**
* The CSSTextField class implements CSS text styles in a TextField.
@@ -69,7 +70,8 @@ package org.apache.flex.core
var sp:Object = parent;
if (!sp)
sp = styleParent;
-
+ sp.addEventListener("classNameChanged", updateStyles);
+
var tf: TextFormat = new TextFormat();
tf.font = ValuesManager.valuesImpl.getValue(sp, "fontFamily") as String;
tf.size = ValuesManager.valuesImpl.getValue(sp, "fontSize");
@@ -108,5 +110,11 @@ package org.apache.flex.core
defaultTextFormat = tf;
super.text = value;
}
+
+ private function updateStyles(event:Event):void
+ {
+ // force styles to be re-calculated
+ this.text = text;
+ }
}
}
\ No newline at end of file