mirror of
https://github.com/m1k1o/neko.git
synced 2025-04-28 18:06:20 +02:00
do not test for hover when checking touch device.
This commit is contained in:
parent
85bfaf31c3
commit
540b2e0a88
1 changed files with 4 additions and 5 deletions
|
@ -367,12 +367,11 @@
|
|||
|
||||
get is_touch_device() {
|
||||
return (
|
||||
// check if the device has a touch screen
|
||||
// detect if the device has touch support
|
||||
('ontouchstart' in window || navigator.maxTouchPoints > 0) &&
|
||||
// we also check if the device has a pointer
|
||||
!window.matchMedia('(pointer:fine)').matches &&
|
||||
// and is capable of hover, then it probably has a mouse
|
||||
!window.matchMedia('(hover:hover)').matches
|
||||
// the primary input mechanism includes a pointing device of
|
||||
// limited accuracy, such as a finger on a touchscreen.
|
||||
window.matchMedia('(pointer: coarse)').matches
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue