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 f49dbfe07e
commit 9f9da33e0f
2 changed files with 10 additions and 1 deletions

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