Repository: flex-asjs
Updated Branches:
  refs/heads/develop cf53944e5 -> 689282967


FooterSocialButton


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

Branch: refs/heads/develop
Commit: 689282967b579a5e9213b06ff39c407222433703
Parents: cf53944
Author: Carlos Rovira <[email protected]>
Authored: Sat Jan 7 01:34:02 2017 +0100
Committer: Carlos Rovira <[email protected]>
Committed: Sat Jan 7 01:34:02 2017 +0100

----------------------------------------------------------------------
 .../MDLExample/src/main/flex/MainFooter.mxml    |   3 +
 .../org/apache/flex/mdl/FooterSocialButton.as   | 108 +++++++++++++++++++
 .../src/main/resources/mdl-manifest.xml         |   1 +
 3 files changed, 112 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/68928296/examples/flexjs/MDLExample/src/main/flex/MainFooter.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/MainFooter.mxml 
b/examples/flexjs/MDLExample/src/main/flex/MainFooter.mxml
index 43b6c90..2b2b1f4 100644
--- a/examples/flexjs/MDLExample/src/main/flex/MainFooter.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/MainFooter.mxml
@@ -40,5 +40,8 @@ limitations under the License.
     </mdl:FooterLeftSection>
 
     <mdl:FooterRightSection>
+        <mdl:FooterSocialButton>1</mdl:FooterSocialButton>
+        <mdl:FooterSocialButton>2</mdl:FooterSocialButton>
+        <mdl:FooterSocialButton>3</mdl:FooterSocialButton>
     </mdl:FooterRightSection>
 </mdl:Footer>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/68928296/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterSocialButton.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterSocialButton.as
 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterSocialButton.as
new file mode 100644
index 0000000..ff2a8d8
--- /dev/null
+++ 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterSocialButton.as
@@ -0,0 +1,108 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+       import org.apache.flex.html.TextButton;
+       import org.apache.flex.mdl.supportClasses.IFooterSection;
+       import org.apache.flex.core.UIBase;
+    
+    COMPILE::JS
+    {
+        import org.apache.flex.core.WrappedHTMLElement;
+    }
+    
+       /**
+        *  The FooterSocialButton class is a Container component capable of 
parenting other
+        *  components 
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion FlexJS 0.0
+        */
+       public class FooterSocialButton extends TextButton
+       {
+               /**
+                *  constructor.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion FlexJS 0.0
+                */
+               public function FooterSocialButton()
+               {
+                       super();
+
+                       className = ""; //set to empty string avoid 'undefined' 
output when no class selector is assigned by user;
+               }
+               
+        /**
+         * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+         */
+        COMPILE::JS
+        override protected function createElement():WrappedHTMLElement
+        {
+                       typeNames = "mdl-mega-footer__social-btn";
+
+            element = document.createElement('button') as WrappedHTMLElement;
+            
+            positioner = element;
+            element.flexjs_wrapper = this;
+
+            return element;
+        }
+
+               /**
+         *  Configuration depends on parent Footer.
+                *  Check to see if is mega or mini.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+        */ 
+               COMPILE::JS
+               override public function addedToParent():void
+        {
+                       super.addedToParent();
+
+                       if(parent is IFooterSection)
+                       {
+                               var parentSection:IFooterSection = parent as 
IFooterSection;
+                               if(UIBase(parentSection).parent is Footer)
+                               {
+                                       element.classList.remove(typeNames);
+                                       
if(!Footer(UIBase(parentSection).parent).mini)
+                                       {
+                                               typeNames = 
"mdl-mega-footer__social-btn";
+                                       } else
+                                       {
+                                               typeNames = 
"mdl-mini-footer__social-btn";
+                                       }
+                                       element.classList.add(typeNames);
+                               }
+                       }
+                       else
+                       {
+                               throw new Error("FooterSocialButton can not be 
used if parent is not a MDL Footer component.");
+                       }                       
+        }
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/68928296/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 adfc1e7..cbc254f 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
@@ -87,6 +87,7 @@
     <component id="FooterLogo" class="org.apache.flex.mdl.FooterLogo"/>
     <component id="FooterLinkList" class="org.apache.flex.mdl.FooterLinkList"/>
     <component id="FooterLinkItemRenderer" 
class="org.apache.flex.mdl.itemRenderers.FooterLinkItemRenderer"/>
+    <component id="FooterSocialButton" 
class="org.apache.flex.mdl.FooterSocialButton"/>
 
 
     <component id="TabBarView" 
class="org.apache.flex.mdl.beads.views.TabBarView"/>

Reply via email to