-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
.on events have no 'this' defined #59
Comments
This isn't such a bad idea. It makes you explicitly force the context. The only issue is that you need to keep references to the InputBindings after addInput calls if you wish to use them later. Would you consider allowing bindings to be added with a 'key'. Then extending the API to include a getBinding(key) call? addInput(menu, 'value', {key:'myid',....}); Later on I can then just call tweakpane.getBinding('myid'); Chris |
I don't have a plan to add |
Fixed in #69. Please wait for the next release. |
I noticed when binding to an 'on' event that 'this' is undefined when the handler is called.
For example:
tweakpane.addInput(menu, 'value', someconfig)
.on('change', myfunction);
where
myfunction(value) {
//doing something here
//but 'this' undefined unless you explicitly call 'bind' on the handler function
}
Should 'this' be set to the input interface instance?
Chris
The text was updated successfully, but these errors were encountered: