Mark touch events as passive
This commit is contained in:
parent
518160a1fa
commit
7ec0dcfec8
@ -23,7 +23,7 @@ module.exports = function slideoutMenu(viewport, menu) {
|
|||||||
function onTouchStart(e) {
|
function onTouchStart(e) {
|
||||||
if (e.touches.length !== 1) {
|
if (e.touches.length !== 1) {
|
||||||
onTouchEnd();
|
onTouchEnd();
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var touch = e.touches.item(0);
|
var touch = e.touches.item(0);
|
||||||
@ -37,7 +37,7 @@ module.exports = function slideoutMenu(viewport, menu) {
|
|||||||
touchStartTime = Date.now();
|
touchStartTime = Date.now();
|
||||||
|
|
||||||
viewport.addEventListener("touchmove", onTouchMove);
|
viewport.addEventListener("touchmove", onTouchMove);
|
||||||
viewport.addEventListener("touchend", onTouchEnd);
|
viewport.addEventListener("touchend", onTouchEnd, {passive: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ module.exports = function slideoutMenu(viewport, menu) {
|
|||||||
menuIsMoving = false;
|
menuIsMoving = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
viewport.addEventListener("touchstart", onTouchStart);
|
viewport.addEventListener("touchstart", onTouchStart, {passive: true});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
disable: disableSlideout,
|
disable: disableSlideout,
|
||||||
|
Loading…
Reference in New Issue
Block a user