Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / docs / source / FitLayout.html
index 361a2ee..3c538b1 100644 (file)
@@ -1,17 +1,12 @@
-<html>
-<head>
-  <title>The source code</title>
-    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
-    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
-</head>
-<body  onload="prettyPrint();">
-    <pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-<div id="cls-Ext.layout.FitLayout"></div>/**\r
+<html>\r
+<head>\r
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    \r
+  <title>The source code</title>\r
+    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body  onload="prettyPrint();">\r
+    <pre class="prettyprint lang-js"><div id="cls-Ext.layout.FitLayout"></div>/**\r
  * @class Ext.layout.FitLayout\r
  * @extends Ext.layout.ContainerLayout\r
  * <p>This is a base class for layouts that contain <b>a single item</b> that automatically expands to fill the layout's\r
@@ -36,12 +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
-            var sz = (Ext.isIE6 && Ext.isStrict && target.dom == document.body) ? target.getViewSize() : target.getStyleSize();\r
-            this.setItemSize(this.activeItem || ct.items.itemAt(0), sz);\r
+        if(!ct.collapsed){\r
+            this.setItemSize(this.activeItem || ct.items.itemAt(0), this.getLayoutTargetSize());\r
         }\r
     },\r
 \r
@@ -52,6 +57,6 @@ Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, {
         }\r
     }\r
 });\r
-Ext.Container.LAYOUTS['fit'] = Ext.layout.FitLayout;</pre>
-</body>
+Ext.Container.LAYOUTS['fit'] = Ext.layout.FitLayout;</pre>    \r
+</body>\r
 </html>
\ No newline at end of file