Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / source / Editor2.html
diff --git a/docs/source/Editor2.html b/docs/source/Editor2.html
new file mode 100644 (file)
index 0000000..34ba461
--- /dev/null
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <title>The source code</title>
+  <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
+  <script type="text/javascript" src="../prettify/prettify.js"></script>
+  <style type="text/css">
+    .highlight { display: block; background-color: #ddd; }
+  </style>
+  <script type="text/javascript">
+    function highlight() {
+      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+    }
+  </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+  <pre class="prettyprint lang-js"><span id='Ext-layout-component-Editor'>/**
+</span> * Component layout for editors
+ * @class Ext.layout.component.Editor
+ * @extends Ext.layout.component.Component
+ * @private
+ */
+Ext.define('Ext.layout.component.Editor', {
+
+    /* Begin Definitions */
+
+    alias: ['layout.editor'],
+
+    extend: 'Ext.layout.component.Component',
+
+    /* End Definitions */
+
+    onLayout: function(width, height) {
+        var me = this,
+            owner = me.owner,
+            autoSize = owner.autoSize;
+            
+        if (autoSize === true) {
+            autoSize = {
+                width: 'field',
+                height: 'field'    
+            };
+        }
+        
+        if (autoSize) {
+            width = me.getDimension(owner, autoSize.width, 'Width', width);
+            height = me.getDimension(owner, autoSize.height, 'Height', height);
+        }
+        me.setTargetSize(width, height);
+        owner.field.setSize(width, height);
+    },
+    
+    getDimension: function(owner, type, dimension, actual){
+        var method = 'get' + dimension;
+        switch (type) {
+            case 'boundEl':
+                return owner.boundEl[method]();
+            case 'field':
+                return owner.field[method]();
+            default:
+                return actual;
+        }
+    }
+});</pre>
+</body>
+</html>