Ticket #6387: 6387_3.patch
File 6387_3.patch, 1.5 KB (added by , 13 years ago) |
---|
-
_source/plugins/autogrow/plugin.js
39 39 { 40 40 init : function( editor ) 41 41 { 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 } ) 43 43 { 44 44 editor.on( eventName, function( evt ) 45 45 { … … 49 49 // Disable autogrow when the editor is maximized .(#6339) 50 50 ( !maximize || maximize.state != CKEDITOR.TRISTATE_ON ) ) 51 51 { 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 ); 53 70 } 54 71 }); 55 72 } 73 editor.on( 'contentDom', function() 74 { 75 var html = editor.document.getDocumentElement(); 76 html.setCustomData( 'savedOverflow', html.getStyle( 'overflow' ) ); 77 }); 56 78 } 57 79 }); 58 80 })();