generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 71
Closed as not planned
Labels
feature requestNew feature or requestNew feature or request
Description
Is your Feature Request Related to a Problem?
I have a button that should only actually do things when a metadata value is above some number.
Describe the Feature you'd Like
It'd be great to be able to do a simple bit of logic and return false (or something) if a button's actions should stop.
Additional Context
For example:
label: Level Up
icon: "crown"
hidden: true
id: "xp-level"
style: primary
actions:
- type: inlineJS
code: "if (this.context.metadata.frontmatter.xp < 1000){ console.log('not enough xp'); return false; }"
- type: updateMetadata
bindTarget: xp
evaluate: true
value: x - 1000
- type: updateMetadata
bindTarget: level
evaluate: true
value: x + 1
Metadata
Metadata
Assignees
Labels
feature requestNew feature or requestNew feature or request