push: add active class to container element

This commit is contained in:
jean-emmanuel 2018-06-20 16:53:21 +02:00
parent ae7fce5b06
commit 4f086eb63f

View file

@ -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()