Roo/bootstrap/Button.js
authorEdward <edward@roojs.com>
Mon, 31 Mar 2014 10:19:37 +0000 (18:19 +0800)
committerEdward <edward@roojs.com>
Mon, 31 Mar 2014 10:19:37 +0000 (18:19 +0800)
Roo/bootstrap/Button.js

index 99dd052..f219263 100644 (file)
@@ -113,6 +113,26 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             return cfg;
         }
         
+        if (this.badge) {
+            cfg.html += ' ';
+            
+            cfg.tag = 'a';
+            
+            cfg.cls='btn roo-button';
+            
+            cfg.href=this.href;
+            
+            cfg.cn = [
+                cfg.html,
+                {
+                    tag: 'span',
+                    cls: 'badge',
+                    html: this.badge
+                }
+            ];
+            
+            cfg.html='';
+        }
          
         if (this.theme==='default') {
             cfg.cls = 'btn roo-button';