FCKEditor event handling -
07-19-2007
, 02:35 AM
I have several FCKEditor panels on the same ASP.NET 1.1 page. I am
using the onblur and onfocus events of FCKEditor to collapse and
expand the toolbar when the user places the cursor in or out of the
editor panel. This is working great. However, since the toolbar is
expanded, I'd also like to be able to expand the height of the current
FCKEditor panel onfocus and then reduce the height again when leaving
the Editor panel and collapsing the toolbar again. I have tried
several variations of the code below to no avail. Has anybody had a
similar experience and come up with a solution?
<script type="text/javascript">
function FCKeditor_OnComplete( editorInstance )
{
editorInstance.Events.AttachEvent( 'OnBlur' , FCKeditor_OnBlur ) ;
editorInstance.Events.AttachEvent( 'OnFocus', FCKeditor_OnFocus ) ;
}
function FCKeditor_OnBlur( editorInstance )
{
editorInstance.ToolbarSet.Collapse() ;
editorInstance.Height = 200 ;
}
function FCKeditor_OnFocus( editorInstance )
{
var oEditor =
FCKeditorAPI.GetInstance(editorInstance.Name).Edit orWindow.parent ;
oEditor.Height = "1000px" ;
editorInstance.ToolbarSet.Expand() ;
}
</script> |