Hi Tobias

It is possible to override widget methods. The following retrieves the 
constructor for the button widget.

require("$:/core/modules/widgets/button.js”).button

>From that, you can access the prototype and override any methods you want.

Obviously, this is a technique of last resort…

Best wishes

Jeremy.

> On 17 Dec 2015, at 19:58, Tobias Beer <[email protected]> wrote:
> 
> I was wondering if it was possible for my own (widget) code to...
> require some core widget
> overwrite one of the functions of the required module
> use that to create instances for my own widget
> Possible?
> 
> Or do I have to create a custom widget / overwritten one?
> 
> Alternatively, is there any chance to hijack any core (widget's) prototype 
> functions?
> If so, how would one do it?
> 
> Specifically, I'd like to hijack triggerPopup from the ButtonWidget.
> 
> Best wishes,
> 
> Tobias.
> 
> -- 
> 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] 
> <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/tiddlywikidev 
> <https://groups.google.com/group/tiddlywikidev>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywikidev/00d7769d-4541-46b3-a90c-adbfb051b1fd%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywikidev/00d7769d-4541-46b3-a90c-adbfb051b1fd%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 
"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 https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/BD1B8BE6-3145-472E-9BE5-3798B21A673F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to