Ticket #4762: 4762.patch

File 4762.patch, 2.1 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/sourcearea/plugin.js

     
    4848                                                                'text-align' : 'left'
    4949                                                        };
    5050
    51                                                         // The textarea height/width='100%' doesn't
    52                                                         // constraint to the 'td' in IE strick mode
     51                                                        // Making the textarea fixed sized to conque the following bugs:
     52                                                        // 1. The textarea height/width='100%' doesn't constraint to the 'td' in IE6/7.
     53                                                        // 2. Unexpected scroll behavior happens when textarea is overflowed. (#4762)   
    5354                                                        if ( CKEDITOR.env.ie )
    5455                                                        {
    55                                                                 if ( !CKEDITOR.env.ie8Compat )
    56                                                                 {
    57                                                                         onResize = function()
    58                                                                                 {
    59                                                                                         // Holder rectange size is stretched by textarea,
    60                                                                                         // so hide it just for a moment.
    61                                                                                         textarea.hide();
    62                                                                                         textarea.setStyle( 'height', holderElement.$.clientHeight + 'px' );
    63                                                                                         // When we have proper holder size, show textarea again.
    64                                                                                         textarea.show();
    65                                                                                 };
    66                                                                         editor.on( 'resize', onResize );
    67                                                                         editor.on( 'afterCommandExec', function( event )
    68                                                                         {
    69                                                                                 if ( event.data.name == 'toolbarCollapse' )
     56                                                                onResize = function()
     57                                                                {
     58                                                                        // Holder rectange size is stretched by textarea,
     59                                                                        // so hide it just for a moment.
     60                                                                        textarea.hide();
     61                                                                        textarea.setStyle( 'height', holderElement.$.clientHeight + 'px' );
     62                                                                        textarea.setStyle( 'width', holderElement.$.clientWidth + 'px' );
     63                                                                        // When we have proper holder size, show textarea again.
     64                                                                        textarea.show();
     65                                                                };
     66                                                                editor.on( 'resize', onResize );
     67                                                                editor.on( 'afterCommandExec', function( event )
     68                                                                {
     69                                                                        if ( event.data.name == 'toolbarCollapse' )
    7070                                                                                        onResize();
    7171                                                                        });
    72                                                                         styles.height = holderElement.$.clientHeight + 'px';
    73                                                                 }
    74                                                         }
     72                                                                setTimeout( onResize, 0 );
     73                                                        }
    7574                                                        else
    7675                                                        {
    7776                                                                // By some yet unknown reason, we must stop the
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy