324 | | CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, resizeInner ) |
325 | | { |
326 | | var container = this.container, |
327 | | contents = CKEDITOR.document.getById( 'cke_contents_' + this.name ), |
328 | | outer = resizeInner ? container.getChild( 1 ) : container; |
| 324 | ( function() |
| 325 | { |
| 326 | |
| 327 | var resizerFixer = CKEDITOR.tools.withInterval( function( container ) |
| 328 | { |
| 329 | // We can't simply hide the entire editor otherwise it breaks the host page scroll. (#6212) |
| 330 | container.setStyle( 'display', 'inline-block' ); |
| 331 | setTimeout( function() { container.setStyle( 'display', 'block' ); }, 0 ); |
| 332 | }, 500 ); |
| 333 | |
| 334 | CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, resizeInner ) |
| 335 | { |
| 336 | var container = this.container, |
| 337 | contents = CKEDITOR.document.getById( 'cke_contents_' + this.name ), |
| 338 | outer = resizeInner ? container.getChild( 1 ) : container; |
330 | | // Resize the width first. |
331 | | // WEBKIT BUG: Webkit requires that we put the editor off from display when we |
332 | | // resize it. If we don't, the browser crashes! |
333 | | CKEDITOR.env.webkit && outer.setStyle( 'display', 'none' ); |
334 | | // Set as border box width. (#5353) |
335 | | outer.setSize( 'width', width, true ); |
336 | | if ( CKEDITOR.env.webkit ) |
337 | | { |
338 | | outer.$.offsetWidth; |
339 | | outer.setStyle( 'display', '' ); |
340 | | } |
| 340 | // WEBKIT: Webkit requires a chrome re-layout. (#5729) |
| 341 | CKEDITOR.env.webkit && resizerFixer( this, null, outer ); |
| 342 | |
| 343 | // Set as border box width. (#5353) |
| 344 | outer.setSize( 'width', width, true ); |
342 | | // Get the height delta between the outer table and the content area. |
343 | | // If we're setting the content area's height, then we don't need the delta. |
344 | | var delta = isContentHeight ? 0 : ( outer.$.offsetHeight || 0 ) - ( contents.$.clientHeight || 0 ); |
345 | | contents.setStyle( 'height', Math.max( height - delta, 0 ) + 'px' ); |
| 346 | // Get the height delta between the outer table and the content area. |
| 347 | // If we're setting the content area's height, then we don't need the delta. |
| 348 | var delta = isContentHeight ? 0 : ( outer.$.offsetHeight || 0 ) - ( contents.$.clientHeight || 0 ); |
| 349 | contents.setStyle( 'height', Math.max( height - delta, 0 ) + 'px' ); |