X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fautogrow%2Fplugin.js;h=d6c4697a96de384e77dbdc8bda9cb7f5ca248b45;hb=1056598c95187351dc58f4991d331e2258d038b5;hp=cd3fc3da65e484e6682a94d3cf35bfd9ff851795;hpb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;p=ckeditor.git diff --git a/_source/plugins/autogrow/plugin.js b/_source/plugins/autogrow/plugin.js index cd3fc3d..d6c4697 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 */ @@ -9,13 +9,17 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function(){ var resizeEditor = function( editor ) { + if ( !editor.window ) + return; var doc = editor.document, currentHeight = editor.window.getViewPaneSize().height, 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 +45,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 +80,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