widgets: remove unnused properties to avoid having hidden properties laying around when the type changes (especially dangerous when those properties where linked to other widgets)

This commit is contained in:
jean-emmanuel 2018-07-04 10:15:26 +02:00
parent 61e0654f88
commit 18cba88bad
2 changed files with 10 additions and 1 deletions

View file

@ -1,10 +1,15 @@
# Changelog
## 0.33.1
- bug fixes
- widgets: remove unnused properties to avoid having hidden properties laying around when the type changes (especially dangerous when those properties where linked to other widgets)
## 0.33.0
- bug fixes
- osc receivers: unregister properly when widgets are recreated (memory leak); allow non-string values (eg. objects)
- circular property update issues
- circular property update issues
- widgets
- **new** generic `matrix` widget
- fader: restore right-click focusing the input in compact mode (mouse only)

View file

@ -48,6 +48,10 @@ var Parser = class Parser {
if (i.indexOf('_')!=0 && props[i]===undefined) props[i] = defaults[i]
}
for (let j in props) {
if (defaults[j] === undefined || j[0] === '_') delete props[j]
}
// Genrate widget's id, based on its type
if (props.id=='auto' || !props.id ) {
var id