Add a button to a note? #4626
Unanswered
XaverStiensmeier
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Sorry for late reply, but I would implement this as a custom widget: https://github.com/zadam/trilium/wiki/Custom-widget which would display a button. You can see it has this method: isEnabled() {
return super.isEnabled()
&& this.note.type === 'text'
&& this.note.hasLabel('wordCount');
} It's only enabled (displayed) if a current note has a specific label. This is a common pattern, but you can use any condition, e.g. based on note's type. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it somehow possible to add some kind of button to a note? Basically a thingy when pressed executes an arbitrary function - doesn't have to be a real button.
In my concrete use case, multiple buttons are needed, but are not relevant enough to stay in the toolbar the whole time. They are only needed when certain notes are navigated. I feel like
addButtonToToolbar(opts)
doesn't allow for that functionality and am missing another way to implement my use case.Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions