Replies: 3 comments 1 reply
-
Use |
Beta Was this translation helpful? Give feedback.
-
@oeyoews apologies, I suspect now that I missed a crucial detail in your original post. Are you trying to send a custom DOM event, or a custom widget message?
TiddlyWiki5/core/modules/widgets/action-sendmessage.js Lines 85 to 93 in 9069992 |
Beta Was this translation helpful? Give feedback.
-
I'm trying to trigger some TiddlyWiki events in js, some of which require a navigator widget, and I didn't know how to handle them, so I tried the motion plugin approach. Actually, using the startup module to add a custom event to pass data is a bad solution here, because the corresponding listener is not always added at the beginning. Just encapsulating it into a function and triggering it when the user clicks is enough. module.exports = () => {
function getNavigatorWidget(widget) {
const child = widget.children?.[0];
if (child?.parseTreeNode.type == 'navigator') {
return child;
}
return getNavigatorWidget(child);
}
const menubarNav = getNavigatorWidget($tw.rootWidget);
return menubarNav;
} |
Beta Was this translation helpful? Give feedback.
-
I want to trigger a
menubarNavChange
event and pass detail, but it seems that detail is intercepted by tiddlywiki, and I can't getdetail
.Is it something I did wrong? @Jermolene
Beta Was this translation helpful? Give feedback.
All reactions