You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2016/11/07 07:02:25 UTC

[37/40] git commit: [flex-asjs] [refs/heads/feature/mdl] - removed CardEffect bead and incorporated to Card component

removed CardEffect bead and incorporated to Card component


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

Branch: refs/heads/feature/mdl
Commit: a07f61840ead50e7ccc17618d60d0060f6d6cb7a
Parents: 8bf6156
Author: Carlos Rovira <ca...@apache.org>
Authored: Sat Nov 5 02:01:27 2016 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Sat Nov 5 02:01:27 2016 +0100

----------------------------------------------------------------------
 .../flexjs/MDLExample/src/main/flex/App.mxml    |   5 +-
 .../src/main/flex/org/apache/flex/mdl/Card.as   |  26 ++++-
 .../org/apache/flex/mdl/beads/CardEffect.as     | 100 -------------------
 .../src/main/resources/mdl-manifest.xml         |   1 -
 4 files changed, 26 insertions(+), 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a07f6184/examples/flexjs/MDLExample/src/main/flex/App.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/App.mxml b/examples/flexjs/MDLExample/src/main/flex/App.mxml
index 3393a5e..9b3f6fe 100644
--- a/examples/flexjs/MDLExample/src/main/flex/App.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/App.mxml
@@ -113,10 +113,7 @@ limitations under the License.
                     
                 </js:VContainer>
 
-                <mdl:Card width="512">
-                    <js:beads>
-                        <mdl:CardEffect shadow="2"/>
-                    </js:beads>
+                <mdl:Card width="512" shadow="2">
                     <mdl:CardTitle style="color: #666;height: 176px; backgroundImage: url('../../../../src/main/resources/Unknown.jpeg') center / cover;">
                         <js:H2 text="Welcome" className="mdl-card__title-text"/>
                     </mdl:CardTitle>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a07f6184/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Card.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Card.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Card.as
index c8c1dd2..3835d86 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Card.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Card.as
@@ -76,6 +76,30 @@ package org.apache.flex.mdl
             className = typeNames = "mdl-card";
 
             return element;
-        }    
+        }
+		
+		protected var _shadow:Number = 0;
+        /**
+		 *  A boolean flag to activate "mdl-shadow--4dp" effect selector.
+		 *  Assigns variable shadow depths (0, 2, 3, 4, 6, 8, or 16) to card
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+        public function get shadow():Number
+        {
+            return _shadow;
+        }
+        public function set shadow(value:Number):void
+        {
+			if(value == 0 || value == 2 || value == 3 || value == 4 || value == 6 || value == 8 || value == 16)
+			{
+				_shadow = value;
+
+				className += _shadow != 0 ? " mdl-shadow--" + _shadow + "dp" : "";
+			}  
+        }
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a07f6184/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/CardEffect.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/CardEffect.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/CardEffect.as
deleted file mode 100644
index 19e3396..0000000
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/CardEffect.as
+++ /dev/null
@@ -1,100 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.mdl.beads
-{
-	import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.IBead;
-	import org.apache.flex.mdl.Card;
-	
-	
-	/**
-	 *  The CardEffect class is a specialty bead that can be used with
-	 *  a MDL Card control to apply some MDL complementary effect.
-	 *  
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10.2
-	 *  @playerversion AIR 2.6
-	 *  @productversion FlexJS 0.0
-	 */
-	public class CardEffect implements IBead
-	{
-		/**
-		 *  constructor.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function CardEffect()
-		{
-		}
-
-		private var _shadow:Number = 0;
-		private var _shadowStyle:String = "";
-        /**
-		 *  A boolean flag to activate "mdl-shadow--4dp" effect selector.
-		 *  Assigns variable shadow depths (0, 2, 3, 4, 6, 8, or 16) to card
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-        public function get shadow():Number
-        {
-            return _shadow;
-        }
-        public function set shadow(value:Number):void
-        {
-            if(value == 0) {
-				_shadowStyle = "";
-			} else {
-				_shadow = value;
-                _shadowStyle = " mdl-shadow--" + _shadow + "dp";
-            }  
-        }
-
-		private var _strand:IStrand;
-		
-		/**
-		 *  @copy org.apache.flex.core.IBead#strand
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 *  @flexjsignorecoercion org.apache.flex.mdl.TextInput;
-		 */
-		public function set strand(value:IStrand):void
-		{
-			_strand = value;
-			
-			COMPILE::JS
-			{
-				if (value is Card) {
-					var card:Card = value as Card;
-					card.className =  _shadowStyle;
-				} else {
-					throw new Error("Host component must be an MDL Card.");
-				}
-			}
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a07f6184/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
index e45ef84..0bcb2c7 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
@@ -35,7 +35,6 @@
     <component id="CardSupportingText" class="org.apache.flex.mdl.CardSupportingText"/>
     <component id="CardMedia" class="org.apache.flex.mdl.CardMedia"/>
     <component id="CardActions" class="org.apache.flex.mdl.CardActions"/>
-    <component id="CardEffect" class="org.apache.flex.mdl.beads.CardEffect"/>
     <component id="CardInnerEffect" class="org.apache.flex.mdl.beads.CardInnerEffect"/>
 
 </componentPackage>