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

[MainUI] Possibility to clear multiple variables at once #407

Closed
rgrollfitz opened this issue Oct 17, 2020 · 2 comments
Closed

[MainUI] Possibility to clear multiple variables at once #407

rgrollfitz opened this issue Oct 17, 2020 · 2 comments
Labels
enhancement New feature or request main ui Main UI

Comments

@rgrollfitz
Copy link

It would be nice to clear multiple variables at once (e.g. on a button click)
'clearVariable' currently only works with one parameter.

@rgrollfitz rgrollfitz changed the title [MainUI] Possibility to clear multiple variables [MainUI] Possibility to clear multiple variables at once Oct 17, 2020
@ghys ghys added enhancement New feature or request main ui Main UI labels Oct 17, 2020
@ghys
Copy link
Member

ghys commented Oct 17, 2020

This rang a bell so I had to check and apparently we were on the same page 🙂

if (this.config.clearVariable) {
if (Array.isArray(this.config.clearVariable)) {
this.config.clearVariable.forEach((v) => this.$set(this.context.vars, v, undefined))
} else if (typeof this.config.clearVariable === 'string') {
this.$set(this.context.vars, this.config.clearVariable, undefined)
}

(same for oh-link)

Looks like if you provide an array it should clear all the variables in it! Let me know if it works for you.
Should have been documented in the parameter description though. I'll probably review all of those at some point and will add the info.

@rgrollfitz
Copy link
Author

rgrollfitz commented Oct 17, 2020

@ghys Works flawlessly :) - Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

No branches or pull requests

2 participants