norelease toggle doesn't sync anymore
This commit is contained in:
parent
07b67f10d2
commit
05594ca878
3 changed files with 12 additions and 3 deletions
|
|
@ -69,6 +69,9 @@ class Toggle extends Widget {
|
|||
this.active = true
|
||||
this.setValue(this.getProp('on'), {sync: true, send: true})
|
||||
|
||||
if (tap) this.container.classList.add('active')
|
||||
|
||||
|
||||
}, {element: this.widget})
|
||||
|
||||
}
|
||||
|
|
@ -78,7 +81,9 @@ class Toggle extends Widget {
|
|||
if (!this.active) return
|
||||
|
||||
this.active = false
|
||||
this.setValue(this.getProp('off'), {sync: true, send: !tap})
|
||||
|
||||
if (!tap) this.setValue(this.getProp('off'), {sync: true, send: true})
|
||||
if (tap) this.container.classList.remove('active')
|
||||
|
||||
}, {element: this.widget})
|
||||
|
||||
|
|
@ -151,6 +156,10 @@ class Toggle extends Widget {
|
|||
if (options.send) this.sendValue()
|
||||
if (options.sync) this.changed(options)
|
||||
|
||||
if (newstate && this.getProp('mode') === 'tap') {
|
||||
this.setValue(this.getProp('off'), {sync: false, send: false})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class Root extends StaticProperties(Panel, {scroll: false, label: false, id: 'ro
|
|||
|
||||
}, [
|
||||
'label',
|
||||
'_geometry', 'left', 'top', 'width', 'height',
|
||||
'_geometry', 'left', 'top', 'width', 'height', 'expand',
|
||||
'colorFill', 'colorStroke', 'alphaStroke', 'alphaFillOff',
|
||||
], {
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
}
|
||||
|
||||
&.on {
|
||||
&.on, &.active {
|
||||
|
||||
--alpha-fill:var(--alpha-fill-on);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue