mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
robust improvement
This commit is contained in:
parent
247f41f33c
commit
ecd81d9045
1 changed files with 14 additions and 5 deletions
|
@ -15,6 +15,7 @@ let frame;
|
|||
let scrollvalue;
|
||||
let version;
|
||||
let timeoutEvent;
|
||||
let performingAction = false;
|
||||
|
||||
export default class Home {
|
||||
static init () {
|
||||
|
@ -45,6 +46,17 @@ export default class Home {
|
|||
//////////////////////////
|
||||
|
||||
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.holding = false;
|
||||
// if ((t.nodeName == "INPUT") || (t.nodeName == "FORM")) return;
|
||||
|
@ -107,11 +119,8 @@ export default class Home {
|
|||
if (e.touches && (e.touches.length > 1)) {
|
||||
return;
|
||||
}
|
||||
if (isTablet) {
|
||||
frame.ontouchmove = undefined;
|
||||
} else {
|
||||
frame.onmousemove = undefined;
|
||||
}
|
||||
frame.ontouchmove = undefined;
|
||||
frame.onmousemove = undefined;
|
||||
if (timeoutEvent) {
|
||||
clearTimeout(timeoutEvent);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue