preventDefault on MozMousePixelScroll

This prevents scrolling without changing the zoom delta
calculations.

Fixes #1794
This commit is contained in:
John Firebaugh 2013-06-27 10:27:34 -04:00
parent bc40266bc9
commit 725124931f

View File

@ -9,11 +9,13 @@ L.Map.mergeOptions({
L.Map.ScrollWheelZoom = L.Handler.extend({
addHooks: function () {
L.DomEvent.on(this._map._container, 'mousewheel', this._onWheelScroll, this);
L.DomEvent.on(this._map._container, 'MozMousePixelScroll', L.DomEvent.preventDefault);
this._delta = 0;
},
removeHooks: function () {
L.DomEvent.off(this._map._container, 'mousewheel', this._onWheelScroll);
L.DomEvent.off(this._map._container, 'MozMousePixelScroll', L.DomEvent.preventDefault);
},
_onWheelScroll: function (e) {