Merge pull request #332 from samatjain/firefox
Support Firefox Mobile/Fennec
This commit is contained in:
commit
60b1e72bbd
@ -22,6 +22,31 @@
|
||||
mobileOpera: mobile && opera,
|
||||
|
||||
mobile: mobile,
|
||||
touch: ('ontouchstart' in document.documentElement)
|
||||
touch: (function() {
|
||||
var touchSupported = false;;
|
||||
|
||||
// WebKit, etc
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Firefox/Gecko
|
||||
var e = document.createElement('div');
|
||||
|
||||
// If no support for basic event stuff, unlikely to have touch support
|
||||
if (!e.setAttribute || !e.removeAttribute) {
|
||||
return false;
|
||||
}
|
||||
|
||||
e.setAttribute('ontouchstart', 'return;');
|
||||
if (typeof e['ontouchstart'] == 'function') {
|
||||
touchSupported = true;
|
||||
}
|
||||
|
||||
e.removeAttribute('ontouchstart');
|
||||
e = null;
|
||||
|
||||
return touchSupported;
|
||||
})()
|
||||
};
|
||||
})();
|
@ -30,7 +30,7 @@ L.Draggable = L.Class.extend({
|
||||
},
|
||||
|
||||
_onDown: function(e) {
|
||||
if (e.shiftKey || ((e.which != 1) && (e.button != 1) && !e.touches)) { return; }
|
||||
if ((!L.Browser.touch && e.shiftKey) || ((e.which != 1) && (e.button != 1) && !e.touches)) { return; }
|
||||
|
||||
if (e.touches && e.touches.length > 1) { return; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user