It would be nice to be able to pass a parameter to functions from the inspector.
Usage example:
You have a series of buttons that when clicked, change the background color of a particular element, each button changing it to a different color. At the moment, the only way I can figure how to do it is to have something like this:
function button1(hypeDocument, element, event) {
hypeDocument.getElementById("someElement").style.backgroundColor = "red";
}
function button2(hypeDocument, element, event) {
hypeDocument.getElementById("someElement").style.backgroundColor = "green";
}
function button3(hypeDocument, element, event) {
hypeDocument.getElementById("someElement").style.backgroundColor = "blue";
}
So 3 separate functions, one for each button. This can quickly get out of hand if you have a lot of buttons. I’m not sure how you could do this more efficiently at the moment, short of maybe adding the color you want in the button’s element id and extracting it from there, or checking which color to pick based on the button’s position.
It would be nice if when you call a javascript function, you have a text field under it in the inspector where you can enter whatever you want (or nothing!) and the definitions would look like this:
function button(hypeDocument, element, event, extraParameter) {
hypeDocument.getElementById("someElement").style.backgroundColor = extraParameter;
}
That way you only write one function for all buttons instead of a separate function for each button, or have to resort to ugly, error-prone tricks.
This is just a quality-of-life feature more than anything, but thanks for reading and considering it