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

git commit: [flex-asjs] [refs/heads/feature/mdl] - Fix badges to conform to MDL

Repository: flex-asjs
Updated Branches:
  refs/heads/feature/mdl 31ae5398d -> 8936da17e


Fix badges to conform to MDL


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

Branch: refs/heads/feature/mdl
Commit: 8936da17ea3a5cc29a3d24300f94c19a92dd57b8
Parents: 31ae539
Author: Carlos Rovira <ca...@apache.org>
Authored: Fri Nov 4 17:42:13 2016 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Fri Nov 4 17:42:13 2016 +0100

----------------------------------------------------------------------
 .../flexjs/MDLExample/src/main/flex/App.mxml     | 19 ++++++++++++++++---
 .../main/flex/org/apache/flex/mdl/beads/Badge.as |  6 +++---
 2 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8936da17/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 34aacb8..f0bae30 100644
--- a/examples/flexjs/MDLExample/src/main/flex/App.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/App.mxml
@@ -109,17 +109,30 @@ limitations under the License.
                 <mdl:Slider minimum="0" maximum="10" value="2" stepSize="2" width="200"/>
 
                 <js:VContainer>
-                    <js:A text="This is a Badge" href="http://flex.apache.org">
+                    <js:Div text="account_box" className="material-icons" style="color: rgba(0, 0, 0, 0.24);">
                         <js:beads>
-                            <mdl:Badge dataBadge="5" overlap="true" noBackground="true"/>
+                            <mdl:Badge dataBadge="1" overlap="true"/>
+                        </js:beads>
+                    </js:Div>
+
+                    <js:Span text="Inbox" className="mdl-badge" style="color: rgba(0, 0, 0, 0.24);">
+                        <js:beads>
+                            <mdl:Badge dataBadge="4"/>
+                        </js:beads>
+                    </js:Span>
+
+                    <js:A text="Badge No Bg" href="http://flex.apache.org">
+                        <js:beads>
+                            <mdl:Badge dataBadge="5" noBackground="true"/>
                         </js:beads>
                     </js:A>
 
-                    <js:A id="badge1" text="Loving this." href="http://flex.apache.org">
+                    <js:A id="badge1" text="Badge Normal" href="http://flex.apache.org">
                         <js:beads>
                             <mdl:Badge dataBadge="1"/>
                         </js:beads>
                     </js:A>
+                    
                 </js:VContainer>
 
                 <mdl:Card width="512">

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8936da17/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/Badge.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/Badge.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/Badge.as
index 02fdfe6..66f5f8a 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/Badge.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/Badge.as
@@ -135,17 +135,17 @@ package org.apache.flex.mdl.beads
 				if (host.element is HTMLSpanElement)
 				{
 					var span:HTMLSpanElement = host.element as HTMLSpanElement;
-					span.className = "mdl-badge " + _noBackground + _overlap;
+					span.className += " mdl-badge " + _noBackground + _overlap;
 					span.setAttribute('data-badge', _dataBadge.toString());
 				} else if (host.element is HTMLDivElement)
 				{
 					var div:HTMLDivElement = host.element as HTMLDivElement;
-					div.className = "mdl-badge " + _noBackground + _overlap;
+					div.className += " mdl-badge " + _noBackground + _overlap;
 					div.setAttribute('data-badge', _dataBadge.toString());
 				} else if (host.element is HTMLElement)
 				{
 					var a:HTMLElement = host.element as HTMLElement;
-					a.className = "mdl-badge " + _noBackground + _overlap;
+					a.className += " mdl-badge " + _noBackground + _overlap;
 					a.setAttribute('data-badge', _dataBadge.toString());
 				} else
 				{