take two on fix for touch + mouse on PC laptops
This commit is contained in:
parent
99f898caec
commit
bf2322649a
1 changed files with 8 additions and 0 deletions
|
|
@ -477,7 +477,9 @@ CAM.init = function(kiri, api) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (moto.space.info.mob) {
|
if (moto.space.info.mob) {
|
||||||
|
let touched = false;
|
||||||
el.ontouchstart = (ev) => {
|
el.ontouchstart = (ev) => {
|
||||||
|
touched = true;
|
||||||
if (poppedRec === rec && popped) {
|
if (poppedRec === rec && popped) {
|
||||||
onLeave(ev);
|
onLeave(ev);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -486,6 +488,12 @@ CAM.init = function(kiri, api) {
|
||||||
};
|
};
|
||||||
el.ontouchmove = onDown;
|
el.ontouchmove = onDown;
|
||||||
el.onmouseenter = (ev) => {
|
el.onmouseenter = (ev) => {
|
||||||
|
if (touched) {
|
||||||
|
// touches block mouse events on touchscreen PCs
|
||||||
|
// which are often sent along with touch events
|
||||||
|
// but when not touched, allow the mouse to work
|
||||||
|
return;
|
||||||
|
}
|
||||||
el.onmousedown = onDown;
|
el.onmousedown = onDown;
|
||||||
el.onmouseleave = onLeave;
|
el.onmouseleave = onLeave;
|
||||||
onEnter(ev);
|
onEnter(ev);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue