X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=plugins%2Fautogrow%2Fplugin.js;h=4b518a290f4e8114d7fdd213e80ae6fafd4ee3a2;hb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;hp=63c2add042aa9505dea468df93e407381990bf96;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b;p=ckeditor.git diff --git a/plugins/autogrow/plugin.js b/plugins/autogrow/plugin.js index 63c2add..4b518a2 100644 --- a/plugins/autogrow/plugin.js +++ b/plugins/autogrow/plugin.js @@ -1,6 +1,6 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ -(function(){var a=function(b){var c=b.document,d=b.window.getViewPaneSize().height,e;if(CKEDITOR.env.ie||CKEDITOR.env.gecko)e=c.getBody().$.scrollHeight+(CKEDITOR.env.ie&&CKEDITOR.env.quirks?0:24);else e=c.getDocumentElement().$.offsetHeight;var f=b.config.autoGrow_minHeight,g=b.config.autoGrow_maxHeight;f==undefined&&(b.config.autoGrow_minHeight=f=200);if(f)e=Math.max(e,f);if(g)e=Math.min(e,g);if(e!=d){e=b.fire('autoGrow',{currentHeight:d,newHeight:e}).newHeight;b.resize(b.container.getStyle('width'),e,true);}};CKEDITOR.plugins.add('autogrow',{init:function(b){for(var c in {contentDom:1,key:1,selectionChange:1,insertElement:1})b.on(c,function(d){var e=b.getCommand('maximize');if(d.editor.mode=='wysiwyg'&&(!e||e.state!=CKEDITOR.TRISTATE_ON))setTimeout(function(){a(d.editor);},100);});}});})(); +(function(){function a(d){var e=d.getStyle('overflow-y'),f=d.getDocument(),g=CKEDITOR.dom.element.createFromHtml(''+(CKEDITOR.env.webkit?' ':'')+'',f);f[CKEDITOR.env.ie?'getBody':'getDocumentElement']().append(g);var h=g.getDocumentPosition(f).y+g.$.offsetHeight;g.remove();d.setStyle('overflow-y',e);return h;};function b(d){var e=d.document,f=e.getBody(),g=e.getDocumentElement();return e.$.compatMode=='BackCompat'?f:g;};var c=function(d){if(!d.window)return;var e=b(d),f=d.window.getViewPaneSize().height,g=a(e);g+=d.config.autoGrow_bottomSpace||0;var h=d.config.autoGrow_minHeight!=undefined?d.config.autoGrow_minHeight:200,i=d.config.autoGrow_maxHeight||Infinity;g=Math.max(g,h);g=Math.min(g,i);if(g!=f){g=d.fire('autoGrow',{currentHeight:f,newHeight:g}).newHeight;d.resize(d.container.getStyle('width'),g,true);}if(e.$.scrollHeight>e.$.clientHeight&&g