Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / docs / source / FitLayout.html
index cced26c..3c538b1 100644 (file)
@@ -31,11 +31,22 @@ Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, {
     // private\r
     monitorResize:true,\r
 \r
+    type: 'fit',\r
+\r
+    getLayoutTargetSize : function() {\r
+        var target = this.container.getLayoutTarget();\r
+        if (!target) {\r
+            return {};\r
+        }\r
+        // Style Sized (scrollbars not included)\r
+        return target.getStyleSize();\r
+    },\r
+\r
     // private\r
     onLayout : function(ct, target){\r
         Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target);\r
-        if(!this.container.collapsed){\r
-            this.setItemSize(this.activeItem || ct.items.itemAt(0), target.getViewSize(true));\r
+        if(!ct.collapsed){\r
+            this.setItemSize(this.activeItem || ct.items.itemAt(0), this.getLayoutTargetSize());\r
         }\r
     },\r
 \r