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:
parent
4910f1f0f4
commit
52c1386450
2 changed files with 43 additions and 16 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue