Skip horizontal scroll on wheel events. Thanks to Julius Buset and his laptop's trackpad.

This commit is contained in:
Iván Sánchez Ortega 2015-11-30 17:09:30 +01:00
parent a969d20476
commit fa3da6503f

View File

@ -185,6 +185,7 @@ L.DomEvent = {
return (e.deltaY && e.deltaMode === 0) ? -e.deltaY : // Pixels
(e.deltaY && e.deltaMode === 1) ? -e.deltaY * 18 : // Lines
(e.deltaY && e.deltaMode === 2) ? -e.deltaY * 52 : // Pages
(e.deltaX || e.deltaZ) ? 0 : // Skip horizontal/depth wheel events
e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : // Legacy IE pixels
(e.detail && Math.abs(e.detail) < 32765) ? -e.detail * 18 : // Legacy Moz lines
e.detail ? e.detail / -32765 * 52 : // Legacy Moz pages