-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Restyle map attribution button * Allow disabling tooltip in HistogramWidget and fix hover on disabled bars for touch devices * Fix Clear button not appearing on iOS devices
- Loading branch information
Showing
5 changed files
with
91 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// https://patrickhlauke.github.io/touch/touchscreen-detection/ | ||
export default function detectTouchscreen() { | ||
var result = false; | ||
if (window.PointerEvent && ('maxTouchPoints' in navigator)) { | ||
// if Pointer Events are supported, just check maxTouchPoints | ||
if (navigator.maxTouchPoints > 0) { | ||
result = true; | ||
} | ||
} else { | ||
// no Pointer Events... | ||
if (window.matchMedia && window.matchMedia("(any-pointer:coarse)").matches) { | ||
// check for any-pointer:coarse which mostly means touchscreen | ||
result = true; | ||
} else if (window.TouchEvent || ('ontouchstart' in window)) { | ||
// last resort - check for exposed touch events API / event handler | ||
result = true; | ||
} | ||
} | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters