props: dynamic color fixes
This commit is contained in:
parent
ade59a8be8
commit
453f2b6f0f
2 changed files with 7 additions and 9 deletions
|
|
@ -364,7 +364,7 @@ class Widget extends EventEmitter {
|
|||
return
|
||||
|
||||
case 'color':
|
||||
this.container.style.setProperty('--color-custom', this.getProp('color') != 'auto' ? this.getProp('color') : 'initial')
|
||||
this.container.style.setProperty('--color-custom', this.getProp('color') != 'auto' ? this.getProp('color') : '')
|
||||
return
|
||||
|
||||
case 'precision':
|
||||
|
|
|
|||
|
|
@ -202,27 +202,25 @@ class Panel extends Widget {
|
|||
|
||||
onPropChanged(propName, options) {
|
||||
|
||||
var ret = super.onPropChanged(...arguments)
|
||||
var ret = super.onPropChanged(propName, options)
|
||||
|
||||
switch (propName) {
|
||||
|
||||
case 'color':
|
||||
DOM.each(this.widget, 'canvas', (canvas)=>{
|
||||
var w = widgetManager.getWidgetByElement(canvas)
|
||||
if (w.cacheCanvasStyle) {
|
||||
w.cacheCanvasStyle()
|
||||
w.batchDraw()
|
||||
for (var h of this.childrenHashes) {
|
||||
if (widgetManager.widgets[h]) {
|
||||
widgetManager.widgets[h].onPropChanged('color')
|
||||
}
|
||||
})
|
||||
}
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
onRemove() {
|
||||
this.off('resize')
|
||||
super.onRemove()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue