Roo/bootstrap/Element.js
authorEdward <edward@roojs.com>
Mon, 28 Apr 2014 10:14:36 +0000 (18:14 +0800)
committerEdward <edward@roojs.com>
Mon, 28 Apr 2014 10:14:36 +0000 (18:14 +0800)
Roo/bootstrap/Element.js

index 1d4ed1b..46cbfef 100644 (file)
@@ -40,6 +40,18 @@ Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component,  {
         
        
         return cfg;
+    },
+    
+    adjustWidth : function(width){
+        if(typeof width == "number"){
+            if(this.autoBoxAdjust && !this.isBorderBox()){
+               width -= (this.getBorderWidth("lr") + this.getPadding("lr"));
+            }
+            if(width < 0){
+                width = 0;
+            }
+        }
+        return width;
     }
    
 });