toggle: make doubletap exclusive
This commit is contained in:
parent
706951371e
commit
cb5b024511
1 changed files with 8 additions and 7 deletions
|
|
@ -49,15 +49,8 @@ module.exports = class Toggle extends _widgets_base {
|
|||
this.widget.value = this.widget.find('span')
|
||||
this.widget.state = 0
|
||||
|
||||
this.widget.on('drag',(e)=>{e.stopPropagation()})
|
||||
this.widget.on('draginit.toggle',()=>{
|
||||
this.widget.off('draginit.toggle')
|
||||
this.fakeclick()
|
||||
})
|
||||
|
||||
if (this.getProp('led')) this.container.addClass('led')
|
||||
|
||||
|
||||
if (this.getProp('doubleTap')) {
|
||||
|
||||
doubletab(this.widget, ()=>{
|
||||
|
|
@ -65,6 +58,14 @@ module.exports = class Toggle extends _widgets_base {
|
|||
this.setValue(newVal,{sync:true,send:true})
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
// this.widget.on('drag',(e)=>{e.stopPropagation()})
|
||||
this.widget.on('draginit.toggle',()=>{
|
||||
this.widget.off('draginit.toggle')
|
||||
this.fakeclick()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
this.classHolders = this.widget.add(this.container)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue