[Pkg-javascript-commits] [leaflet] 30/78: Backport of pointer fixes in #3839
Jonas Smedegaard
dr at jones.dk
Sat May 7 08:58:44 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet.
commit 4b289ab8071e480c182bb5df76bbfe0cac2a54e0
Author: danzel <danzel at localhost.geek.nz>
Date: Tue Sep 15 09:40:03 2015 +1200
Backport of pointer fixes in #3839
---
src/core/Browser.js | 2 +-
src/dom/DomEvent.Pointer.js | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/core/Browser.js b/src/core/Browser.js
index 326276d..2f186e9 100644
--- a/src/core/Browser.js
+++ b/src/core/Browser.js
@@ -18,7 +18,7 @@
mobile = typeof orientation !== undefined + '',
msPointer = !window.PointerEvent && window.MSPointerEvent,
- pointer = (window.PointerEvent && window.navigator.pointerEnabled && window.navigator.maxTouchPoints) ||
+ pointer = (window.PointerEvent && window.navigator.pointerEnabled) ||
msPointer,
retina = ('devicePixelRatio' in window && window.devicePixelRatio > 1) ||
('matchMedia' in window && window.matchMedia('(min-resolution:144dpi)') &&
diff --git a/src/dom/DomEvent.Pointer.js b/src/dom/DomEvent.Pointer.js
index 4957fcd..254696b 100644
--- a/src/dom/DomEvent.Pointer.js
+++ b/src/dom/DomEvent.Pointer.js
@@ -36,8 +36,9 @@ L.extend(L.DomEvent, {
pointers = this._pointers;
var cb = function (e) {
-
- L.DomEvent.preventDefault(e);
+ if (e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
+ L.DomEvent.preventDefault(e);
+ }
var alreadyInArray = false;
for (var i = 0; i < pointers.length; i++) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet.git
More information about the Pkg-javascript-commits
mailing list