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 2014/12/23 08:41:42 UTC

[19/28] git commit: [flex-asjs] [refs/heads/develop] - default x and y positions

default x and y positions


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

Branch: refs/heads/develop
Commit: edfda77bc052ac3541500d7d9f6f2b28ca5f3565
Parents: 1395c57
Author: Alex Harui <ah...@apache.org>
Authored: Mon Dec 22 10:02:48 2014 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Dec 22 10:02:48 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/edfda77b/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 5035b8c..a1753d4 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
@@ -399,6 +399,8 @@ org.apache.flex.core.UIBase.prototype.set_x = function(pixels) {
 org.apache.flex.core.UIBase.prototype.get_x = function() {
   var strpixels = this.positioner.style.left;
   var pixels = parseFloat(strpixels);
+  if (isNaN(pixels))
+    pixels = this.positioner.offsetLeft;
   return pixels;
 };
 
@@ -420,6 +422,8 @@ org.apache.flex.core.UIBase.prototype.set_y = function(pixels) {
 org.apache.flex.core.UIBase.prototype.get_y = function() {
   var strpixels = this.positioner.style.top;
   var pixels = parseFloat(strpixels);
+  if (isNaN(pixels))
+    pixels = this.positioner.offsetTop;
   return pixels;
 };
 
@@ -701,7 +705,7 @@ org.apache.flex.core.UIBase.prototype.get_className = function() {
 org.apache.flex.core.UIBase.prototype.set_className = function(value) {
   if (this.className !== value)
   {
-    this.element.className = this.typeNames ? value + " " + this.typeNames : value;
+    this.element.className = this.typeNames ? value + ' ' + this.typeNames : value;
     this.className = value;
     this.dispatchEvent('classNameChanged');
   }