From 77a9bd6bf177325c21069f58ec31a3509c41f082 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Mon, 2 Aug 2021 21:38:16 +0800 Subject: [PATCH] Fix longClick --- libs/actions.js | 4 ---- libs/ui.js | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/actions.js b/libs/actions.js index 1c21c452..f1bcaee2 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -590,10 +590,6 @@ actions.prototype._sys_onup = function () { // 长按 if (!core.status.lockControl && stepPostfix.length == 0 && core.status.downTime != null && new Date() - core.status.downTime >= 1000) { - clearTimeout(core.interval.onDownTimeout); - core.interval.onDownTimeout = null; - clearInterval(core.interval.onDownInterval); - core.interval.onDownInterval = null; core.actions.longClick(posx, posy, 32 * posx + 16, 32 * posy + 16); } else { diff --git a/libs/ui.js b/libs/ui.js index c304e5d3..25682fd0 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -673,6 +673,9 @@ ui.prototype.closePanel = function () { core.status.event.selection = null; core.status.event.ui = null; core.status.event.interval = null; + // 清除onDownInterval + clearInterval(core.interval.onDownInterval); + core.interval.onDownInterval = 'tmp'; } ui.prototype.clearUI = function () {