You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2015/11/13 21:21:40 UTC

git commit: [flex-asjs] [refs/heads/core_js_to_as] - Fixed setter functions for UIBase percentWidth and percentHeight.

Repository: flex-asjs
Updated Branches:
  refs/heads/core_js_to_as 0ce5c1ca7 -> a2aff215d


Fixed setter functions for UIBase percentWidth and percentHeight.


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

Branch: refs/heads/core_js_to_as
Commit: a2aff215d30faf8e94baeadc27529b8ea9de83ca
Parents: 0ce5c1c
Author: Peter Ent <pe...@apache.org>
Authored: Fri Nov 13 15:21:37 2015 -0500
Committer: Peter Ent <pe...@apache.org>
Committed: Fri Nov 13 15:21:37 2015 -0500

----------------------------------------------------------------------
 .../Core/as/src/org/apache/flex/core/UIBase.as  | 45 ++++++++++++++------
 1 file changed, 31 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a2aff215/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as b/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
index 366f3a6..184f02e 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
@@ -253,13 +253,21 @@ package org.apache.flex.core
          */
 		public function set percentWidth(value:Number):void
 		{
-			if (_percentWidth == value)
-				return;
-			
-			if (!isNaN(value))
-				_explicitWidth = NaN;
-			
-			_percentWidth = value;
+			COMPILE::AS3 {
+				if (_percentWidth == value)
+					return;
+				
+				if (!isNaN(value))
+					_explicitWidth = NaN;
+				
+				_percentWidth = value;
+			}
+			COMPILE::JS {
+				this._percentWidth = value;
+				this.positioner.style.width = value.toString() + '%';
+				if (!isNaN(value))
+					this._explicitWidth = NaN;
+			}
 			
 			dispatchEvent(new Event("percentWidthChanged"));
 		}
@@ -288,13 +296,22 @@ package org.apache.flex.core
          */
 		public function set percentHeight(value:Number):void
 		{
-			if (_percentHeight == value)
-				return;
-			
-			if (!isNaN(value))
-				_explicitHeight = NaN;
-			
-			_percentHeight = value;
+			COMPILE::AS3 {
+				if (_percentHeight == value)
+					return;
+				
+				if (!isNaN(value))
+					_explicitHeight = NaN;
+				
+				_percentHeight = value;
+			}
+				
+			COMPILE::JS {
+				this._percentHeight = value;
+				this.positioner.style.height = value.toString() + '%';
+				if (!isNaN(value))
+					this._explicitHeight = NaN;
+			}
 			
 			dispatchEvent(new Event("percentHeightChanged"));
 		}