当前位置:Gxlcms >
数据库问题 >
react fake double , bind click and dblclick on the same element
react fake double , bind click and dblclick on the same element
时间:2021-07-01 10:21:17
帮助过:3人阅读
(id,name,waiter,e){
var desk = $$(e.currentTarget).data(‘raw‘
);
if(
this.lastClickTime[id] && ((
new Date())-
this.lastClickTime[id])>70
)
{//quick click twice , it seems a dblclick
console.log(‘dblclick‘
);
this.lastClickTime[id]=
undefined;
this.clickHandler && clearTimeout(
this.clickHandler);
this.clickHandler = 0
;
return;
}
if(!
this.clickHandler)
{
this.clickHandler=setTimeout(
function(){
console.log(‘click‘
);
this.lastClickTime[id]=
undefined;
clearTimeout(this.clickHandler);
this.clickHandler = 0
;
}.bind(this),300
);
this.lastClickTime[id]=
new Date();
}
return;
},
react fake double , bind click and dblclick on the same element
标签: