Modified ignite template properties function to dynamically change properties. Fixed a few bugs as well.
This commit is contained in:
parent
d080d8e175
commit
645af63c30
@ -376,6 +376,17 @@ class IgniteTemplate {
|
||||
|
||||
Object.getOwnPropertyNames(props).forEach(name => this.property(name, props[name], true));
|
||||
}
|
||||
else if (props instanceof IgniteProperty) {
|
||||
this._callbacks.push(props.attachOnChange((oldValue, newValue) => {
|
||||
if (newValue) {
|
||||
Object.keys(newValue).forEach(name => this.onPropertyChanged(name, newValue[name]));
|
||||
}
|
||||
}));
|
||||
|
||||
if (props.value) {
|
||||
Object.keys(props.value).forEach(name => this.property(name, props[name], false, null));
|
||||
}
|
||||
}
|
||||
else {
|
||||
Object.keys(props).forEach(name => this.property(name, props[name], false, null));
|
||||
}
|
||||
@ -1482,7 +1493,11 @@ class IgniteTemplate {
|
||||
IgniteRendering.leave();
|
||||
}
|
||||
|
||||
this._properties[propertyName].value = newValue;
|
||||
if (!this._properties[propertyName]) {
|
||||
this._properties[propertyName] = { value: newValue };
|
||||
} else {
|
||||
this._properties[propertyName].value = newValue;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user