Ticket #6387: 6387_3.patch

File 6387_3.patch, 1.5 KB (added by Sa'ar Zac Elias, 13 years ago)
  • _source/plugins/autogrow/plugin.js

     
    3939        {
    4040                init : function( editor )
    4141                {
    42                         for ( var eventName in { contentDom:1, key:1, selectionChange:1, insertElement:1 } )
     42                        for ( var eventName in { contentDom:1, key:1, selectionChange:1, insertElement:1, insertHtml:1 } )
    4343                        {
    4444                                editor.on( eventName, function( evt )
    4545                                {
     
    4949                                                // Disable autogrow when the editor is maximized .(#6339)
    5050                                                ( !maximize || maximize.state != CKEDITOR.TRISTATE_ON ) )
    5151                                        {
    52                                                 setTimeout( function(){ resizeEditor( evt.editor ); }, 100 );
     52                                                var html = editor.document.getDocumentElement(),
     53                                                        savedOverflow = html.getCustomData( 'savedOverflow' );
     54                                                html.setStyle( 'overflow', 'hidden' );
     55
     56                                                setTimeout( function()
     57                                                {
     58                                                        if ( !editor.window )
     59                                                                return;
     60
     61                                                        resizeEditor( evt.editor );
     62
     63                                                        if ( savedOverflow )
     64                                                                html.setStyle( 'overflow', savedOverflow );
     65                                                        else
     66                                                                html.removeStyle( 'overflow' );
     67                                                        var sel = editor.getSelection();
     68                                                        sel && sel.scrollIntoView();
     69                                                }, 100 );
    5370                                        }
    5471                                });
    5572                        }
     73                        editor.on( 'contentDom', function()
     74                        {
     75                                var html = editor.document.getDocumentElement();
     76                                html.setCustomData( 'savedOverflow', html.getStyle( 'overflow' ) );
     77                        });
    5678                }
    5779        });
    5880})();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy