Leaflet 1.0: revert touch style in desktop browsers, fixes #69
This commit is contained in:
parent
6c316c8688
commit
cd6c1bdc54
3 changed files with 34 additions and 0 deletions
24
js/Browser.js
Normal file
24
js/Browser.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
(function () {
|
||||
|
||||
var touchScreen = (function () {
|
||||
var result = null;
|
||||
|
||||
if ('maxTouchPoints' in navigator) {
|
||||
result = navigator.maxTouchPoints > 0;
|
||||
} else if (window.matchMedia && window.matchMedia('(any-pointer:coarse),(any-pointer:fine),(any-pointer:none)').matches) {
|
||||
result = window.matchMedia("(any-pointer:coarse)").matches;
|
||||
} else if ('msMaxTouchPoints' in navigator) {
|
||||
result = navigator.msMaxTouchPoints > 0;
|
||||
};
|
||||
|
||||
return result;
|
||||
}()),
|
||||
touchScreenDetectable = touchScreen !== null;
|
||||
|
||||
|
||||
BR.Browser = {
|
||||
touchScreen: touchScreen,
|
||||
touchScreenDetectable: touchScreenDetectable
|
||||
};
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue