是否有一种智能而简单的方法来检测双击而不会在触摸触摸中触发silgeltap?
日Thnx!
答案 0 :(得分:3)
我认为没有'干净'的方法。它会将单击选项延迟300毫秒,这可能是不可接受的。如果可以,您可能希望简化UI交互。也许点击并按住?
中找到了此代码setupEventHandlers: function(){
this.mon(this.el, {
tap: function(e){
if(this.delayedTask == null){
//setup a delayed task that is called IF double click is not later detected
this.delayedTask = new Ext.util.DelayedTask(
function(){
this.doSomethingInteresting();
this.delayedTask = null;
}, this);
//invoke (with reasonable time to cancel)
this.delayedTask.delay(300);
}
},
doubletap: function(e){
//cancel and clear the queued single click tasks if it's there
if(this.delayedTask != null){
this.delayedTask.cancel();
this.delayedTask = null;
}
//handle the double click
this.doSomethingReallyInteresting();
},
scope: this
});
},