Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / docs / source / HtmlEditor2.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5   <title>The source code</title>
6   <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7   <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8   <style type="text/css">
9     .highlight { display: block; background-color: #ddd; }
10   </style>
11   <script type="text/javascript">
12     function highlight() {
13       document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
14     }
15   </script>
16 </head>
17 <body onload="prettyPrint(); highlight();">
18   <pre class="prettyprint lang-js"><span id='Ext-layout-component-field-HtmlEditor'>/**
19 </span> * @private
20  * @class Ext.layout.component.field.HtmlEditor
21  * @extends Ext.layout.component.field.Field
22  * Layout class for {@link Ext.form.field.HtmlEditor} fields. Sizes the toolbar, textarea, and iframe elements.
23  * @private
24  */
25
26 Ext.define('Ext.layout.component.field.HtmlEditor', {
27     extend: 'Ext.layout.component.field.Field',
28     alias: ['layout.htmleditor'],
29
30     type: 'htmleditor',
31
32     sizeBodyContents: function(width, height) {
33         var me = this,
34             owner = me.owner,
35             bodyEl = owner.bodyEl,
36             toolbar = owner.getToolbar(),
37             textarea = owner.textareaEl,
38             iframe = owner.iframeEl,
39             editorHeight;
40
41         if (Ext.isNumber(width)) {
42             width -= bodyEl.getFrameWidth('lr');
43         }
44         toolbar.setWidth(width);
45         textarea.setWidth(width);
46         iframe.setWidth(width);
47
48         // If fixed height, subtract toolbar height from the input area height
49         if (Ext.isNumber(height)) {
50             editorHeight = height - toolbar.getHeight() - bodyEl.getFrameWidth('tb');
51             textarea.setHeight(editorHeight);
52             iframe.setHeight(editorHeight);
53         }
54     }
55 });</pre>
56 </body>
57 </html>