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 <aha...@apache.org> Authored: Tue Jan 13 10:10:32 2015 -0800 Committer: Alex Harui <aha...@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) {