/**
 * Agreement Form
 */
(function() {
    
    Ext.require('HatimeriaCore.direct.ResponseHandler');
    
    Ext.define('HatimeriaCore.form.AgreementForm', {
        extend: 'Ext.form.Panel',
        config: {
            /**
             * Direct function to content of terms
             */
            directFn: function() {},
            
            /**
             * Optional request parameters
             */
            params: {},
            
            /**
             * Label of form
             */
            label: 'Regulamin',
            
            /**
             * Label behind checkbox
             */
            checkboxLabel: 'Akceptuję requlamin'
        },
        
        /**
         * Constructor
         * 
         * @param {} config
         */
        constructor: function(config)
        {
            this.initConfig(config);
            this.callParent([config]);
            
            return this;
        },
        
        /**
         * Initializes form
         */
        initComponent: function()
        {
            var config = {
                border: false,
                items: [
                    {
                        id: 'agreement-field',
                        fieldLabel: this.getLabel(),
                        labelAlign: 'top',
                        xtype: 'textarea',
                        isFormField: false,
                        readOnly: true,
                        submitValue: false,
                        width: this.initialConfig.width || 350 ,
                        height: 100
                    },
                    {
                        xtype: 'checkbox',
                        fieldLabel: false,
                        boxLabel: this.getCheckboxLabel()+'<em class="ux-required">*</em>',
                        name: 'agreement'
                    }
                ]
            };
            Ext.apply(this, Ext.apply(config, this.initComponent || {}));
            
            this.callParent();
            
            this.on('afterrender', function() {
                this.loadTerms();
            });
        },
        
        /**
         * Load terms of Agreement
         */
        loadTerms: function()
        {
            Ext.create('HatimeriaCore.direct.ResponseHandler', {
                fn: this.getDirectFn(),
                params: this.getParams(),
                scope: this,
                success: function(result) {
                    this.updateTerms(result.record);
                }
            });
        },
        
        /**
         * Updates a textarea field
         * 
         * @param string value
         */
        updateTerms: function(value)
        {
            this.getComponent('agreement-field').setValue(value);
        }
    });
    
})();
@@ -1192,28 +1192,21 @@
     
-id: 'agreement-fi
+xtype: 'lab
 el
-d
 ',%0A 
@@ -1228,26 +1228,20 @@
         
-fieldLabel
+text
 : this.g
@@ -1249,17 +1249,16 @@
 tLabel()
-,
 %0A       
@@ -1274,30 +1274,32 @@
     
+%7D,%0A
     
-labelAlign: 'top',
+                %7B
 %0A   
@@ -1327,24 +1327,21 @@
 xtype: '
-textarea
+panel
 ',%0A     
@@ -1364,25 +1364,28 @@
    i
-sFormField: false
+d: 'agreement-field'
 ,%0A  
@@ -1410,22 +1410,22 @@
     
-readOnly: true
+layout: 'auto'
 ,%0A  
@@ -1450,25 +1450,23 @@
     
-submitValue: fals
+autoScroll: tru
 e,%0A 
@@ -1526,17 +1526,212 @@
 h %7C%7C 350
- 
+,%0A                        bodyStyle: %7B%0A                            background: '#FFF',%0A                            overflow: 'auto'%0A                        %7D,%0A                        margin: '5 0'
 ,%0A      
@@ -1759,16 +1759,50 @@
 ght: 100
+,%0A                        html: ''
 %0A       
@@ -2992,15 +2992,13 @@
 d').
-setValu
+updat
 e(va
@@ -3031,8 +3031,9 @@
   %0A%7D)();
+%0A

fix in agreement form