root: more strict singleton fix
This commit is contained in:
parent
4fe55e77d5
commit
558bbb985a
1 changed files with 8 additions and 1 deletions
|
|
@ -183,10 +183,17 @@ class Widget extends EventEmitter {
|
|||
this.createPropsCache()
|
||||
|
||||
if (this.getProp('id') == 'root' && this.parent !== widgetManager) {
|
||||
this.props.id = '_root'
|
||||
this.cachedProps.id = '_root'
|
||||
this.errors.id = 'There can only be one root'
|
||||
}
|
||||
|
||||
if (this.getProp('type') == 'root' && this.parent !== widgetManager) {
|
||||
this.props.type = 'panel'
|
||||
this.cachedProps.type = 'panel'
|
||||
}
|
||||
|
||||
|
||||
|
||||
// cache decimals
|
||||
if (this.props.decimals !== undefined) {
|
||||
this.decimals = Math.min(20, Math.max(this.getProp('decimals'), 0))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue