So I'm using the FCKEditor inside some collapsible panels. By default they are collapsed on page load. If I expand them and then reload the page, they start working. I've looked at the wiki for information on this. I have found some solutions like the following:
I've tried attaching the switchEditors() to the onclick method for the divs, but it does nothing. Has anyone used the editor inside hidden divs or collapsible panels and gotten stuff to work?
var FCKeditorLoaded = false; function FCKeditor_OnComplete(editorInstance) { FCKeditorLoaded = true; } function switchEditors(ID) { if (FCKeditorLoaded) { setTimeout('switchEditors(\'' + ID + '\')', 500); return; } DoSwitchEditors(document.getElementById(ID)); } function DoSwitchEditors(oNode) { var i; for (i = 0; i < oNode.childNodes.length;i++) { childNode = oNode.childNodes.item(i); editor = FCKeditorAPI.GetInstance(childNode.name); if (editor && editor.EditorDocument && editor.EditMode == FCK_EDITMODE_WYSIWYG) { editor.SwitchEditMode(); editor.SwitchEditMode(); } DoSwitchEditors(childNode); } }
I've tried attaching the switchEditors() to the onclick method for the divs, but it does nothing. Has anyone used the editor inside hidden divs or collapsible panels and gotten stuff to work?