-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
According to the code
dat.gui/src/dat/controllers/Controller.js
Line 40 in a1547d0
| this.property = property; |
However, there are many situations that developers want to differentiate the manipulated property with its display name, such as Chinese words, space, special characters, etc.
We can add a property to the base class - Controller (suppose the new property is named name), and decide whether to use it when we call the .add() method (we can use expression like name || property to set the inner HTML of this Controller),
Line 1143 in a1547d0
| name.innerHTML = controller.property; |
This new property can be set in the second parameter property, too. So the second parameter can be an object or a string normally, it's perfectly compatible to previous version in this way, and the only thing that dat.gui need to handle is judge the type of property and decide whether to set the name in the instance.
I can raise a PR if this approach is acceptable for you.