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

index 3426b9f..bec1d57 100644 (file)
@@ -150,6 +150,32 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             cfg.cls += ' active';
         }
         
+        cfg.cls += this.size.length ? (' btn-' + this.size) : '';
+         
+        //gsRoo.log(this.parentType);
+        if (this.parentType === 'Navbar') {
+            cfg.tag = 'li';
+            
+            cfg.cls = '';
+            cfg.cn =  [{
+                tag : 'a',
+                cls : 'roo-button',
+                html : this.html,
+                href : this.href || '#'
+            }];
+            if (this.menu) {
+                cfg.cn[0].html = this.html  + ' <span class="caret"></span>';
+                cfg.cls += ' dropdown';
+            }   
+            
+            delete cfg.html;
+            
+        } 
+        else if (this.menu) {
+            cfg.cls += ' dropdown';
+            cfg.html = this.html  + ' <span class="caret"></span>';
+        }
+        
         if (this.disabled) {
             cfg.disabled = 'disabled';
         }
@@ -203,32 +229,6 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             cfg.html='';
         }
         
-        cfg.cls += this.size.length ? (' btn-' + this.size) : '';
-         
-        //gsRoo.log(this.parentType);
-        if (this.parentType === 'Navbar') {
-            cfg.tag = 'li';
-            
-            cfg.cls = '';
-            cfg.cn =  [{
-                tag : 'a',
-                cls : 'roo-button',
-                html : this.html,
-                href : this.href || '#'
-            }];
-            if (this.menu) {
-                cfg.cn[0].html = this.html  + ' <span class="caret"></span>';
-                cfg.cls += ' dropdown';
-            }   
-            
-            delete cfg.html;
-            
-        } 
-        else if (this.menu) {
-            cfg.cls += ' dropdown';
-            cfg.html = this.html  + ' <span class="caret"></span>';
-        }
-        
         if (cfg.tag !== 'a' && this.href !== '') {
             throw "Tag must be a to set href.";
         } else if (this.href.length > 0) {