Roo/bootstrap/Button.js
authorEdward <edward@roojs.com>
Thu, 17 Apr 2014 05:22:59 +0000 (13:22 +0800)
committerEdward <edward@roojs.com>
Thu, 17 Apr 2014 05:22:59 +0000 (13:22 +0800)
Roo/bootstrap/Button.js

index 981ea7e..244e2cf 100644 (file)
@@ -154,6 +154,12 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             cfg.disabled = 'disabled';
         }
         
+        if (this.items) {
+            Roo.log('changing to ul' );
+            cfg.tag = 'ul';
+            this.glyphicon = 'caret';
+        }
+        
         cfg.cls += this.size.length ? (' btn-' + this.size) : '';
          
         //gsRoo.log(this.parentType);
@@ -175,10 +181,6 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             delete cfg.html;
             
         } 
-        else if (this.menu) {
-            cfg.cls += ' dropdown';
-            cfg.html = this.html  + ' <span class="caret"></span>';
-        }
         
         if (this.glyphicon) {
             cfg.html = ' ' + cfg.html;
@@ -223,6 +225,11 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             cfg.html='';
         }
         
+        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) {