From cb5b0245119c59e31db2960ba14d155e256518d4 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 17 Aug 2017 23:52:46 +0200 Subject: [PATCH] toggle: make doubletap exclusive --- src/browser/js/app/widgets/buttons/toggle.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/browser/js/app/widgets/buttons/toggle.js b/src/browser/js/app/widgets/buttons/toggle.js index a678b296..4f05e3ec 100644 --- a/src/browser/js/app/widgets/buttons/toggle.js +++ b/src/browser/js/app/widgets/buttons/toggle.js @@ -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)