Ticket #4762: 4762_2.patch

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

     
    1414
    1515        init : function( editor )
    1616        {
    17                 var sourcearea = CKEDITOR.plugins.sourcearea;
     17                var sourcearea = CKEDITOR.plugins.sourcearea,
     18                                win = CKEDITOR.document.getWindow();
    1819
    1920                editor.on( 'editingBlockReady', function()
    2021                        {
     
    4849                                                                'text-align' : 'left'
    4950                                                        };
    5051
    51                                                         // The textarea height/width='100%' doesn't
    52                                                         // constraint to the 'td' in IE strick mode
     52                                                        // Making the textarea fixed sized to conque the following bugs:
     53                                                        // 1. The textarea height/width='100%' doesn't constraint to the 'td' in IE6/7.
     54                                                        // 2. Unexpected scroll behavior happens when textarea is overflowed. (#4762)   
    5355                                                        if ( CKEDITOR.env.ie )
    5456                                                        {
    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' )
    70                                                                                         onResize();
    71                                                                         });
    72                                                                         styles.height = holderElement.$.clientHeight + 'px';
    73                                                                 }
    74                                                         }
     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                                                                        textarea.setStyle( 'width', holderElement.$.clientWidth + 'px' );
     64                                                                        // When we have proper holder size, show textarea again.
     65                                                                        textarea.show();
     66                                                                };
     67
     68                                                                editor.on( 'resize', onResize );
     69                                                                win.on( 'resize', onResize );
     70                                                                setTimeout( onResize, 0 );
     71                                                        }
    7572                                                        else
    7673                                                        {
    7774                                                                // By some yet unknown reason, we must stop the
     
    139136                                                        editor.textarea = textarea = null;
    140137
    141138                                                        if ( onResize )
     139                                                        {
    142140                                                                editor.removeListener( 'resize', onResize );
     141                                                                win.removeListener( 'resize', onResize );
     142                                                        }
    143143
    144144                                                        if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 )
    145145                                                                holderElement.removeStyle( 'position' );
  • _source/plugins/toolbar/plugin.js

     
    263263
    264264                                                                                var dy = toolboxContainer.$.offsetHeight - previousHeight;
    265265                                                                                contents.setStyle( 'height', ( contentHeight - dy ) + 'px' );
     266
     267                                                                                editor.fire( 'resize' );
    266268                                                                        },
    267269
    268270                                                                        modes : { wysiwyg : 1, source : 1 }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy