Merge pull request #3050 from kdeloach/topic/disable-zoom-scrolling
Remove global variable that disables dragging for all maps during zoom
This commit is contained in:
commit
76440b9df2
@ -49,7 +49,7 @@ L.Draggable = L.Evented.extend({
|
|||||||
|
|
||||||
L.DomEvent.stopPropagation(e);
|
L.DomEvent.stopPropagation(e);
|
||||||
|
|
||||||
if (L.Draggable._disabled) { return; }
|
if (L.DomUtil.hasClass(this._element, 'leaflet-zoom-anim')) { return; }
|
||||||
|
|
||||||
L.DomUtil.disableImageDrag();
|
L.DomUtil.disableImageDrag();
|
||||||
L.DomUtil.disableTextSelection();
|
L.DomUtil.disableTextSelection();
|
||||||
|
@ -89,11 +89,6 @@ L.Map.include(!zoomAnimated ? {} : {
|
|||||||
this._animateToCenter = center;
|
this._animateToCenter = center;
|
||||||
this._animateToZoom = zoom;
|
this._animateToZoom = zoom;
|
||||||
|
|
||||||
// disable any dragging during animation
|
|
||||||
if (L.Draggable) {
|
|
||||||
L.Draggable._disabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
L.DomUtil.addClass(this._mapPane, 'leaflet-zoom-anim');
|
L.DomUtil.addClass(this._mapPane, 'leaflet-zoom-anim');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,9 +108,5 @@ L.Map.include(!zoomAnimated ? {} : {
|
|||||||
L.DomUtil.removeClass(this._mapPane, 'leaflet-zoom-anim');
|
L.DomUtil.removeClass(this._mapPane, 'leaflet-zoom-anim');
|
||||||
|
|
||||||
this._resetView(this._animateToCenter, this._animateToZoom, true, true);
|
this._resetView(this._animateToCenter, this._animateToZoom, true, true);
|
||||||
|
|
||||||
if (L.Draggable) {
|
|
||||||
L.Draggable._disabled = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user