Roo/bootstrap/Button.js
[roojs1] / Roo / bootstrap / Button.js
index bca82eb..a578c6e 100644 (file)
@@ -69,6 +69,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
     html: false,
     active: false,
     weight: '',
+    outline : false,
     size: '',
     tag: 'button',
     href: '',
@@ -122,7 +123,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
                 ]
             };
             
-            if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
+            if (['default', 'secondary' , 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
                 cfg.cls += ' '+this.weight;
             }
             
@@ -148,7 +149,8 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             //}
             if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
                 
-                cfg.cls += ' btn-' + this.weight;
+                var outline = this.outline || this.weight == 'default' ? 'outline-' : '';
+                cfg.cls += ' btn-' + outline + this.weight;
             }
         } else if (this.theme==='glow') {
             
@@ -375,7 +377,12 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
     
     setWeight : function(str)
     {
-       var outline = this.outline ? 'outline-' : ''
+       this.weight = str;
+        var outline = this.outline ? 'outline-' : '';
+        if (str == 'default') {
+            outline = 'outline-';
+            str = 'secondary';
+        }
         this.el.removeClass(this.weightClass);
         this.el.addClass('btn-' + outline + str);        
     }