X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fautogrow%2Fplugin.js;h=bc23b31892f1e2eeeedbc5a82c6b3984fb231a18;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=cd3fc3da65e484e6682a94d3cf35bfd9ff851795;hpb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;p=ckeditor.git diff --git a/_source/plugins/autogrow/plugin.js b/_source/plugins/autogrow/plugin.js index cd3fc3d..bc23b31 100644 --- a/_source/plugins/autogrow/plugin.js +++ b/_source/plugins/autogrow/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -14,8 +14,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license newHeight; // We can not use documentElement to calculate the height for IE (#6061). - if ( CKEDITOR.env.ie ) - newHeight = doc.getBody().$.scrollHeight + 24; + // It is not good for IE Quirks, yet using offsetHeight would also not work as expected (#6408). + // We do the same for FF because of the html height workaround (#6341). + if ( CKEDITOR.env.ie || CKEDITOR.env.gecko ) + newHeight = doc.getBody().$.scrollHeight + ( CKEDITOR.env.ie && CKEDITOR.env.quirks ? 0 : 24 ); else newHeight = doc.getDocumentElement().$.offsetHeight; @@ -41,9 +43,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { editor.on( eventName, function( evt ) { + var maximize = editor.getCommand( 'maximize' ); // Some time is required for insertHtml, and it gives other events better performance as well. - if ( evt.editor.mode == 'wysiwyg' ) + if ( evt.editor.mode == 'wysiwyg' && + // Disable autogrow when the editor is maximized .(#6339) + ( !maximize || maximize.state != CKEDITOR.TRISTATE_ON ) ) + { setTimeout( function(){ resizeEditor( evt.editor ); }, 100 ); + } }); } } @@ -71,7 +78,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license /** * Fired when the AutoGrow plugin is about to change the size of the editor. - * @name CKEDITOR#autogrow + * @name CKEDITOR.editor#autogrow * @event * @param {Number} data.currentHeight The current height of the editor (before the resizing). * @param {Number} data.newHeight The new height of the editor (after the resizing). It can be changed