flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [17/17] git commit: [flex-asjs] [refs/heads/develop] - don't get fooled by % sizing
Date Tue, 13 Jan 2015 18:11:26 GMT
don't get fooled by % sizing


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

Branch: refs/heads/develop
Commit: f0be94029a03a3efcd889a3a3a444566394e1d89
Parents: 05117d5
Author: Alex Harui <aharui@apache.org>
Authored: Tue Jan 13 10:10:32 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Jan 13 10:10:32 2015 -0800

----------------------------------------------------------------------
 frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f0be9402/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 dfb2323..3e92c17 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
@@ -446,7 +446,10 @@ org.apache.flex.core.UIBase.prototype.set_width = function(pixels) {
 org.apache.flex.core.UIBase.prototype.get_width = function() {
   var pixels;
   var strpixels = this.positioner.style.width;
-  pixels = parseFloat(strpixels);
+  if (strpixels !== null && strpixels.indexOf('%') != -1)
+    pixels = NaN;
+  else
+    pixels = parseFloat(strpixels);
   if (isNaN(pixels)) {
     pixels = this.positioner.offsetWidth;
     if (pixels === 0 && this.positioner.scrollWidth !== 0) {
@@ -516,7 +519,10 @@ org.apache.flex.core.UIBase.prototype.set_height = function(pixels) {
 org.apache.flex.core.UIBase.prototype.get_height = function() {
   var pixels;
   var strpixels = this.positioner.style.height;
-  pixels = parseFloat(strpixels);
+  if (strpixels !== null && strpixels.indexOf('%') != -1)
+    pixels = NaN;
+  else
+    pixels = parseFloat(strpixels);
   if (isNaN(pixels)) {
     pixels = this.positioner.offsetHeight;
     if (pixels === 0 && this.positioner.scrollHeight !== 0) {


Mime
View raw message