Remove global variable that disables dragging for all maps during zoom

Starting a zoom animation will disable dragging for all maps on the
page. Only the map that is being zoomed should have dragging disabled.

This fix removes a global static variable which is redundant since
the map pane already has a css class assigned to it for the duration of
the zoom animation.

Fixes #2539
This commit is contained in:
kdeloach 2014-11-21 14:36:17 -05:00
parent 9128193e5b
commit c97c48325a
2 changed files with 1 additions and 10 deletions

View File

@ -49,7 +49,7 @@ L.Draggable = L.Evented.extend({
L.DomEvent.stopPropagation(e);
if (L.Draggable._disabled) { return; }
if (L.DomUtil.hasClass(this._element, 'leaflet-zoom-anim')) { return; }
L.DomUtil.disableImageDrag();
L.DomUtil.disableTextSelection();

View File

@ -89,11 +89,6 @@ L.Map.include(!zoomAnimated ? {} : {
this._animateToCenter = center;
this._animateToZoom = zoom;
// disable any dragging during animation
if (L.Draggable) {
L.Draggable._disabled = true;
}
L.DomUtil.addClass(this._mapPane, 'leaflet-zoom-anim');
}
@ -113,9 +108,5 @@ L.Map.include(!zoomAnimated ? {} : {
L.DomUtil.removeClass(this._mapPane, 'leaflet-zoom-anim');
this._resetView(this._animateToCenter, this._animateToZoom, true, true);
if (L.Draggable) {
L.Draggable._disabled = false;
}
}
});