Hi Novan

> QUESTION: Is there a built-in method for retrieving a macro's or widget's 
> calling tiddler element/DOM node?

Just to clarify the question, JavaScript macros are invoked with “this” 
pointing to the widget in whose context the macro is to be evaluated, just as a 
method of the widget object would be.

Anyhow, widgets have a couple of standard properties that connect them to the 
DOM tree:

* domNodes, an array of references to the DOM nodes created by the widget itself
* parentDomNode, a reference to the immediate parent DOM node of the widget

> For example, in TWC you could use story.findContainingTiddler(popup_element) 
> to find a popup's calling tiddler's DOM node.

In TW5, there’s far less direct manipulation of the DOM. Unlike TWC, state is 
not kept in the DOM; instead the DOM is dynamically recreated as required from 
the state data stored in tiddlers.

Best wishes

Jeremy.

> Identifying the calling tiddler element provides a way to set the context for 
> traversing the DOM node tree for a specific tiddler (as opposed to say, the 
> entire "document”).



> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/tiddlywiki 
> <https://groups.google.com/group/tiddlywiki>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/19e56524-68c4-44df-af5d-8ad486580a41%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/19e56524-68c4-44df-af5d-8ad486580a41%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/895AD7AE-029A-4744-B480-C459C399BC3A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to