Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document node 'button' property #45

Open
knolleary opened this issue Apr 23, 2017 · 0 comments
Open

Document node 'button' property #45

knolleary opened this issue Apr 23, 2017 · 0 comments

Comments

@knolleary
Copy link
Member

button: {
            toggle: "active",
            enabled: function() {
                return !this.changed
            },
            onclick: function() { }
}

Notes:

  1. toggle identifies this should be a toggle switch (as used by Debug node). Value is a string that identifies the node property whose value should be toggled between true and false.
  2. enabled is a function that can be used to determine if the button is active or not - cannot be used with toggle - new for 0.17.
  3. onclick is a function that is called when the button is clicked. This function is called regardless of what the enabled function may have returned; in other words, even if enabled returned false, this function will still be called when the button is clicked. This allows the node to display a custom notification to tell the user why the button is not enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant