mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-12-01 11:27:16 -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 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;
|
frame.onmousemove = undefined;
|
||||||
} else {
|
|
||||||
frame.onmousemove = undefined;
|
|
||||||
}
|
|
||||||
if (timeoutEvent) {
|
if (timeoutEvent) {
|
||||||
clearTimeout(timeoutEvent);
|
clearTimeout(timeoutEvent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue