fix(theme/book): Use passive listeners for touchstart, touchmove (#575)
This commit is contained in:
parent
6119972fa7
commit
f082187844
|
@ -422,7 +422,7 @@ function playpen_text(playpen) {
|
||||||
x: e.touches[0].clientX,
|
x: e.touches[0].clientX,
|
||||||
time: Date.now()
|
time: Date.now()
|
||||||
};
|
};
|
||||||
});
|
}, { passive: true });
|
||||||
|
|
||||||
document.addEventListener('touchmove', function (e) {
|
document.addEventListener('touchmove', function (e) {
|
||||||
if (!firstContact)
|
if (!firstContact)
|
||||||
|
@ -440,7 +440,7 @@ function playpen_text(playpen) {
|
||||||
|
|
||||||
firstContact = null;
|
firstContact = null;
|
||||||
}
|
}
|
||||||
});
|
}, { passive: true });
|
||||||
|
|
||||||
// Scroll sidebar to current active section
|
// Scroll sidebar to current active section
|
||||||
var activeSection = sidebar.querySelector(".active");
|
var activeSection = sidebar.querySelector(".active");
|
||||||
|
|
Loading…
Reference in New Issue