sync
[roojs1] / Roo / bootstrap / Button.js
index 6762336..2010b97 100644 (file)
 
 Roo.bootstrap.Button = function(config){
     Roo.bootstrap.Button.superclass.constructor.call(this, config);
+    this.weightClass = ["btn-default", 
+                       "btn-primary", 
+                       "btn-success", 
+                       "btn-info", 
+                       "btn-warning",
+                       "btn-danger",
+                       "btn-link"
+                      ],  
     this.addEvents({
         // raw events
         /**
@@ -359,6 +367,11 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
     show: function() {
        
         this.el.show();   
+    },
+    setWeight : function(str)
+    {
+         this.el.removeClass(this.weightClass);
+        this.el.addClass('btn-' + str);        
     }