Hi Neal
First, thanks a lot for all your immediate replies! :)
On 8.6.2006 1:13 Uhr, Neil wrote:
Andreas Wuest wrote:
On 7.6.2006 22:08 Uhr, Neil wrote:
Andreas Wuest wrote:
editorElem.setAttribute("onload", "event.stopPropagation()");
editorWindow = document.getElementById("uiEditorWindow");
editorWindow.appendChild(editorElem);
// set up
editorElem.makeEditable("text", false);
I suggest using at least one of the two opportunities that you have
to wait for it to load.
You mean waiting before I call makeEditable()
As I recall, makeEditable's second parameter is a wait flag, but you
would still have to defer the rest of the code.
To be honest, I could never figure out the correct usage of that flag.
As far as I understand, it waits with turning on editability until the
document to edit has finished loading. Now, what do you do in the case
where you do not load a document at all, but start with a blank editor
and then add text...
The other alternative is
to move the calls starting at makeEditable into the element's onload
handler.
I think this is the way to go then. Over the night, I've played around a
bit with "choked initialization" (you know, the one with setTimeout())
to verify the issue, and it worked (of course, such code gives me
physical pain...).
Now thing is, I think it's more about yielding the thread instead of
waiting. So I wonder, if I just defer the editor setup code into an
onload listener, but continue doing other stuff after creating the
<editor> element, wouldn't I then run into the same problem again,
because basically the tread isn't yielded in this case as well.
--
Kind regards,
Andi
_______________________________________________
dev-tech-editor mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-editor