SalesSystemOnline/ckeditor_3.6/ckeditor/_source/plugins/autogrow/plugin.js
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/**
* @file AutoGrow plugin
*/
(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).
// 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;
var min = editor.config.autoGrow_minHeight,
max = editor.config.autoGrow_maxHeight;
( min == undefined ) && ( editor.config.autoGrow_minHeight = min = 200 );
if ( min )
newHeight = Math.max( newHeight, min );
if ( max )
newHeight = Math.min( newHeight, max );
if ( newHeight != currentHeight )
{
newHeight = editor.fire( 'autoGrow', { currentHeight : currentHeight, newHeight : newHeight } ).newHeight;
editor.resize( editor.container.getStyle( 'width' ), newHeight, true );
}
};
CKEDITOR.plugins.add( 'autogrow',
{
init : function( editor )
{
for ( var eventName in { contentDom:1, key:1, selectionChange:1, insertElement:1 } )
{
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' &&
// Disable autogrow when the editor is maximized .(#6339)
( !maximize || maximize.state != CKEDITOR.TRISTATE_ON ) )
{
setTimeout( function(){ resizeEditor( evt.editor ); }, 100 );
}
});
}
}
});
})();
后面还有 28 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。