Make L.Draggable._dragging "public" again (#5659)

To make Leaflet.Editable happy

See https://github.com/Leaflet/Leaflet.Editable/issues/130
This commit is contained in:
Yohan Boniface 2017-07-24 15:46:32 +02:00 committed by Vladimir Agafonkin
parent 887ad7dad3
commit eb9572800d

View File

@ -21,7 +21,6 @@ import {Point} from '../geometry/Point';
* ``` * ```
*/ */
var _dragging = false;
var START = Browser.touch ? 'touchstart mousedown' : 'mousedown'; var START = Browser.touch ? 'touchstart mousedown' : 'mousedown';
var END = { var END = {
mousedown: 'mouseup', mousedown: 'mouseup',
@ -75,7 +74,7 @@ export var Draggable = Evented.extend({
// If we're currently dragging this draggable, // If we're currently dragging this draggable,
// disabling it counts as first ending the drag. // disabling it counts as first ending the drag.
if (_dragging === this) { if (Draggable._dragging === this) {
this.finishDrag(); this.finishDrag();
} }
@ -97,8 +96,8 @@ export var Draggable = Evented.extend({
if (DomUtil.hasClass(this._element, 'leaflet-zoom-anim')) { return; } if (DomUtil.hasClass(this._element, 'leaflet-zoom-anim')) { return; }
if (_dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; } if (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }
_dragging = this; // Prevent dragging multiple objects at once. Draggable._dragging = this; // Prevent dragging multiple objects at once.
if (this._preventOutline) { if (this._preventOutline) {
DomUtil.preventOutline(this._element); DomUtil.preventOutline(this._element);
@ -222,7 +221,7 @@ export var Draggable = Evented.extend({
} }
this._moving = false; this._moving = false;
_dragging = false; Draggable._dragging = false;
} }
}); });