flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pio...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - FLEX-35269 - Add isDynamic field to constructor for Button and TextField making ability of dynamic creation optional
Date Thu, 23 Feb 2017 22:26:28 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 896142fb9 -> e8449c91c


FLEX-35269 - Add isDynamic field to constructor for Button and TextField making ability of
dynamic creation optional


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

Branch: refs/heads/develop
Commit: e8449c91c337b1d36c0c24e5855283a76d17ca40
Parents: 896142f
Author: piotrz <piotrz@apache.org>
Authored: Thu Feb 23 23:26:23 2017 +0100
Committer: piotrz <piotrz@apache.org>
Committed: Thu Feb 23 23:26:23 2017 +0100

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/mdl/Button.as    | 14 ++++++++++----
 .../src/main/flex/org/apache/flex/mdl/TextField.as | 17 +++++++++++++----
 2 files changed, 23 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e8449c91/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as
index 4a409b6..40abaea 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as
@@ -31,7 +31,7 @@ package org.apache.flex.mdl
     /**
      *  The Button class provides a Material Design Library UI-like appearance for
      *  a Button.
-     *  
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
@@ -41,18 +41,24 @@ package org.apache.flex.mdl
 	{
         /**
          *  Constructor.
-         *  
+         *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.8
+         *
+         *  @param isDynamic indicates whether component can be created dynamically
          */
-		public function Button()
+		public function Button(isDynamic:Boolean = false)
 		{
 			super();
 
             className = ""; //set to empty string avoid 'undefined' output when no class
selector is assigned by user;
-            addBead(new UpgradeElement());
+
+            if (isDynamic)
+            {
+                addBead(new UpgradeElement());
+            }
 		}
         
         /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e8449c91/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextField.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextField.as
index 689532f..dc07a3e 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextField.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextField.as
@@ -48,20 +48,26 @@ package org.apache.flex.mdl
 	public class TextField extends TextFieldBase
 	{
         /**
+         * 
          *  Constructor.
-         *  
+         *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.8
+         *
+         *  @param isDynamic indicates whether component can be created dynamically
          */
-		public function TextField()
+		public function TextField(isDynamic:Boolean = false)
 		{
-			super();
+            _isDynamic = isDynamic;
 
+			super();
             className = ""; //set to empty string avoid 'undefined' output when no class
selector is assigned by user;
 		}
 
+        private var _isDynamic:Boolean;
+
         /**
          * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
          * @flexjsignorecoercion HTMLDivElement
@@ -77,7 +83,10 @@ package org.apache.flex.mdl
             var div:HTMLDivElement = document.createElement('div') as HTMLDivElement;
             div.className = typeNames;
 
-            addBead(new UpgradeElement(div));
+            if (_isDynamic)
+            {
+                addBead(new UpgradeElement(div));
+            }
 
             input = document.createElement('input') as HTMLInputElement;
             input.setAttribute('type', 'text');


Mime
View raw message