On Wednesday, October 7, 2015 at 10:47:23 AM UTC+1, Danielo Rodríguez wrote:
>
>
> El martes, 6 de octubre de 2015, 23:43:49 (UTC+2), BJ escribió:
>>
>> HI Danielo,
>> It is possible to write a widget that creates a dom element and attaches
>> it outside of the page container - it can then listen for dom events
>>
> Indeed. I know that I can listem for events the old normal way. But the
> problem is not only listening to events, but taking advantage of all the
> rendering capabilities that TW provides.
>
>
>
>
>>
>> var messageBox = doc.getElementById("tiddlyclip-message-box");
>> if(!messageBox) {
>> messageBox = doc.createElement("div");
>> messageBox.id = "tiddlyclip-message-box";
>> messageBox.style.display = "none";
>> doc.body.appendChild(messageBox);
>> }
>> // Attach the event handler to the message box
>> messageBox.addEventListener("tiddlyclip-save-file", onSaveFile,false);
>>
>>
> Your listener seems to be just a listener, without any DOM rendering. What
> I want is some interface that can be placed outside TW and survives hidding
> the whole TW container (tc-page-wrapper display none). This is not possible
> because all the widget tree will become "invisible"
>
The widget tree is not made invisible by setting display = none of the
tc-page-wrapper, only its dom subtree is hidden.
To render the child widget outside tc-page-wrapper you can use
this.renderChildren(messageBox,nextSibling);
But thank you very much for the detailed code, I'm sure I will make good
> use of it at some point.
>
>
>
>
>>
>> and the onSaveFile() function generates messages.
>>
>
> What kind of messages exactly? Do you mean that it dispatch the messages
> to TW?
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/16b218f2-1337-4ddc-b0db-0fa50496f91a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.