robust improvement

This commit is contained in:
Yueyu 2021-05-22 08:28:51 +08:00
parent 247f41f33c
commit ecd81d9045

View file

@ -15,6 +15,7 @@ let frame;
let scrollvalue; let scrollvalue;
let version; let version;
let timeoutEvent; let timeoutEvent;
let performingAction = false;
export default class Home { export default class Home {
static init () { static init () {
@ -45,6 +46,17 @@ export default class Home {
////////////////////////// //////////////////////////
static handleTouchStart (e) { static handleTouchStart (e) {
// On my android tablet, when touching a project,
// the tablet triggers the mousedown event
// after touchstart event about 600ms
// --Donald
if (performingAction) {
return;
}
performingAction = true;
setTimeout(function () {
performingAction = false;
}, 1000);
Home.dragging = false; Home.dragging = false;
Home.holding = false; Home.holding = false;
// if ((t.nodeName == "INPUT") || (t.nodeName == "FORM")) return; // if ((t.nodeName == "INPUT") || (t.nodeName == "FORM")) return;
@ -107,11 +119,8 @@ export default class Home {
if (e.touches && (e.touches.length > 1)) { if (e.touches && (e.touches.length > 1)) {
return; return;
} }
if (isTablet) {
frame.ontouchmove = undefined; frame.ontouchmove = undefined;
} else {
frame.onmousemove = undefined; frame.onmousemove = undefined;
}
if (timeoutEvent) { if (timeoutEvent) {
clearTimeout(timeoutEvent); clearTimeout(timeoutEvent);
} }