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

index f4c679e..fab254f 100644 (file)
@@ -266,7 +266,19 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
         cn.items = nitems;
        
         return cn;
-    }
+    },
+    
+    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;
+        }