Roo/bootstrap/Button.js
authorEdward <edward@roojs.com>
Wed, 16 Apr 2014 13:05:55 +0000 (21:05 +0800)
committerEdward <edward@roojs.com>
Wed, 16 Apr 2014 13:05:55 +0000 (21:05 +0800)
Roo/bootstrap/Button.js

index 8395226..3426b9f 100644 (file)
@@ -150,6 +150,59 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             cfg.cls += ' active';
         }
         
+        if (this.disabled) {
+            cfg.disabled = 'disabled';
+        }
+        //????
+        if (this.items) {
+            Roo.log('changing to ul' );
+            cfg.tag = 'ul';
+            this.glyphicon = 'caret';
+        }
+        
+        if (this.glyphicon) {
+            cfg.html = ' ' + cfg.html;
+            
+            cfg.cn = [
+                {
+                    tag: 'span',
+                    cls: 'glyphicon glyphicon-' + this.glyphicon
+                }
+            ];
+        }
+        
+        if (this.badge) {
+            cfg.html += ' ';
+            
+            cfg.tag = 'a';
+            
+//            cfg.cls='btn roo-button';
+            
+            cfg.href=this.href;
+            
+            var value = cfg.html;
+            
+            if(this.glyphicon){
+                value = {
+                            tag: 'span',
+                            cls: 'glyphicon glyphicon-' + this.glyphicon,
+                            html: this.html
+                        };
+                
+            }
+            
+            cfg.cn = [
+                value,
+                {
+                    tag: 'span',
+                    cls: 'badge',
+                    html: this.badge
+                }
+            ];
+            
+            cfg.html='';
+        }
+        
         cfg.cls += this.size.length ? (' btn-' + this.size) : '';
          
         //gsRoo.log(this.parentType);