dynamic props: only fire props-changed event when the widget is not recreated

This commit is contained in:
jean-emmanuel 2018-07-19 10:43:07 +02:00
parent 35bc5a17ae
commit af830e5ee3

View file

@ -444,8 +444,7 @@ class Widget extends EventEmitter {
} else {
this.cachedProps[propName] = propValue
this.onPropChanged(propName, options, oldPropValue)
changedProps.push(propName)
changedProps.push({propName, oldPropValue})
}
@ -459,6 +458,10 @@ class Widget extends EventEmitter {
} else if (changedProps.length) {
for (var i in changedProps) {
this.onPropChanged(changedProps[i].propName, options, changedProps[i].oldPropValue)
}
widgetManager.trigger('prop-changed.*', [{
id: this.getProp('id'),
props: changedProps,