Hi Stephen,
Tobias mentioned "the corresponding action widget", but there actually
isn't one in the code you quoted.
What actually happens when you click a rendered button widget is defined by
the click event handler in *$:/core/modules/widgets/button.js*, which
starts:
* domNode.addEventListener("click",function (event) {*
Any child action widgets get invoked first, then the button widget's *to*
attribute is processed, followed by the *message* attribute, which is
*tm-save-tiddler* in the code you quoted. The *dispatchMessage* function
calls *dispatchEvent*, which can be found in the base Widget class (in
*$:/core/modules/widgets/widget.js*). This looks to see if the current
widget has a function for handling the current message. The button widget
doesn't have a handler for *tm-save-tiddler*, so the message gets
propagated to the parent widget by calling *its* *dispatchEvent* function.
Eventually the message will reach the navigator widget, which *does* have a
handler for *tm-save-tiddler*, namely the *handleSaveTiddlerEvent* function
that you've already found. This handler is installed by the constructor
function for creating any new navigator widget, right at the top of
*$:/core/modules/widgets/navigator.js*.
Hope this helps.
– æ
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" 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/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.