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/1975a7e0
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/1975a7e0
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/1975a7e0

Branch: refs/heads/feature/mdl
Commit: 1975a7e017915438bccafe89d090e8c49c81ba8f
Parents: 595835d
Author: Carlos Rovira <carlosrov...@apache.org>
Authored: Fri Nov 4 17:42:13 2016 +0100
Committer: Carlos Rovira <carlosrov...@apache.org>
Committed: Fri Nov 4 17:43:37 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/1975a7e0/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/1975a7e0/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
                                {

Reply via email to