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; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-layout-component-field-File'>/**
20 * @class Ext.layout.component.field.File
21 * @extends Ext.layout.component.field.Field
22 * Layout class for {@link Ext.form.field.File} fields. Adjusts the input field size to accommodate
23 * the file picker trigger button.
27 Ext.define('Ext.layout.component.field.File', {
28 alias: ['layout.filefield'],
29 extend: 'Ext.layout.component.field.Field',
33 sizeBodyContents: function(width, height) {
37 if (!owner.buttonOnly) {
38 // Decrease the field's width by the width of the button and the configured buttonMargin.
39 // Both the text field and the button are floated left in CSS so they'll stack up side by side.
40 me.setElementSize(owner.inputEl, Ext.isNumber(width) ? width - owner.button.getWidth() - owner.buttonMargin : width);