push: add active class to container element
This commit is contained in:
parent
dfa6bcfc8a
commit
95cd10c57c
1 changed files with 2 additions and 0 deletions
|
|
@ -76,6 +76,7 @@ class Push extends Widget {
|
|||
if (typeof v == 'object' && v !== null) v = v.value
|
||||
if (v===this.getProp('on') || (this.getProp('on') != null && v === this.getProp('on').value && v !== undefined)) {
|
||||
this.widget.classList.add('active')
|
||||
this.container.classList.add('active')
|
||||
this.active = 1
|
||||
this.lastChanged = 'active'
|
||||
this.updateValue()
|
||||
|
|
@ -83,6 +84,7 @@ class Push extends Widget {
|
|||
if (options.sync) this.changed(options)
|
||||
} else if (v===this.getProp('off') || (this.getProp('off') != null && v === this.getProp('off').value && v !== undefined)) {
|
||||
this.widget.classList.remove('active')
|
||||
this.container.classList.remove('active')
|
||||
this.active = 0
|
||||
this.lastChanged = 'active'
|
||||
this.updateValue()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue