widget base class: deeper defaults extend to allow simpler overrides
This commit is contained in:
parent
720799633b
commit
c26c5aaed2
1 changed files with 4 additions and 1 deletions
|
|
@ -162,9 +162,12 @@ class Widget extends EventEmitter {
|
|||
if (obj[i] === null) delete this[i]
|
||||
else {
|
||||
if (this[i] === undefined) this[i] = {}
|
||||
Object.assign(this[i], obj[i])
|
||||
for (let j in obj[i]) {
|
||||
if (obj[i][j] === null) delete this[i][j]
|
||||
else {
|
||||
if (!this[i][j]) this[i][j] = {}
|
||||
Object.assign(this[i][j], obj[i][j])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue