Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2006-10-19 12:57:51

swamp_water
New member
Registered: 2006-10-19
Posts: 3

Refresh editor or kill old editor to reinitialize a new one.

Hi,

I have a dynamic application I am trying to build and it uses tabs with an editor.  I really like this one because it's open source so I was wondering if anybody knew if there was a way to refresh the editor when a surounding div was set to display:block from display:none.  I know that using the startEditors adds another editor and it works good but it reinitiates the entire thing so now there are two.  I need a way to refresh or kill an old editor session.  anyideas?

<a href="javascript:void(0);" onclick="javascript:document.getElementById('edit').style.display = 'block';HTMLArea.startEditors(xinha_editors);">show</a>
<div style="display:none;" id="edit">
Textarea here
</div>

Offline

#2 2006-10-19 14:39:52

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Refresh editor or kill old editor to reinitialize a new one.

I did something like this, too, and there was no problem (if I remember right).

What do you mean with refresh? Is the editor not working when you show the tab? maybe you have to do sth. like this:

var editor = xinha_editors.myEditorId;
editor.deactivateEditor();
document.getElementById('edit').style.display = 'block';
editor.activateEditor();

Offline

#3 2006-10-19 16:24:27

swamp_water
New member
Registered: 2006-10-19
Posts: 3

Re: Refresh editor or kill old editor to reinitialize a new one.

Yes That's exactly what I want to do.

Thanks, P

Offline

#4 2006-10-19 17:04:28

swamp_water
New member
Registered: 2006-10-19
Posts: 3

Re: Refresh editor or kill old editor to reinitialize a new one.

More Specifically I had to do this


code...
  HTMLArea.startEditors(xinha_editors);
  self.setTimeout("hideeditor()",100);
  }
window.onload = xinha_init;
</script>
<script type="text/javascript">
function showeditor(){
    var editor = xinha_editors.myTextArea;
    document.getElementById('edit').style.display = 'block';
    editor.activateEditor();
}

function hideeditor(){
    var editor = xinha_editors.myTextArea;
    editor.deactivateEditor();
    document.getElementById('edit').style.display = 'none';
}
</script>

Offline

Board footer

Powered by FluxBB