X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/docs/source/Editor2.html diff --git a/docs/source/Editor2.html b/docs/source/Editor2.html new file mode 100644 index 00000000..34ba4611 --- /dev/null +++ b/docs/source/Editor2.html @@ -0,0 +1,67 @@ + + + + + The source code + + + + + + +
/**
+ * 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;
+        }
+    }
+});
+ +