1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

refactor(js): enable touch handlers only on touch devices and fix various issues in WebAuthnHandler

This commit is contained in:
Frédéric Guillot 2025-08-02 15:34:54 -07:00
parent 4910f1f0f4
commit 52c1386450
2 changed files with 43 additions and 16 deletions

View file

@ -47,7 +47,7 @@ class TouchHandler {
}
onItemTouchMove(event) {
if (event.touches === undefined || event.touches.length !== 1 || this.element === null) {
if (event.touches === undefined || event.touches.length !== 1 || this.touch.element === null) {
return;
}
@ -151,7 +151,15 @@ class TouchHandler {
}
}
static isTouchSupported() {
return "ontouchstart" in window || navigator.maxTouchPoints > 0;
}
listen() {
if (!TouchHandler.isTouchSupported()) {
return;
}
const eventListenerOptions = { passive: true };
document.querySelectorAll(".entry-swipe").forEach((element) => {