From eb9572800df7a6703423e31defebde04e638c6d7 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 24 Jul 2017 15:46:32 +0200 Subject: [PATCH] Make L.Draggable._dragging "public" again (#5659) To make Leaflet.Editable happy See https://github.com/Leaflet/Leaflet.Editable/issues/130 --- src/dom/Draggable.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js index fe1f9567..772860a6 100644 --- a/src/dom/Draggable.js +++ b/src/dom/Draggable.js @@ -21,7 +21,6 @@ import {Point} from '../geometry/Point'; * ``` */ -var _dragging = false; var START = Browser.touch ? 'touchstart mousedown' : 'mousedown'; var END = { mousedown: 'mouseup', @@ -75,7 +74,7 @@ export var Draggable = Evented.extend({ // If we're currently dragging this draggable, // disabling it counts as first ending the drag. - if (_dragging === this) { + if (Draggable._dragging === this) { this.finishDrag(); } @@ -97,8 +96,8 @@ export var Draggable = Evented.extend({ if (DomUtil.hasClass(this._element, 'leaflet-zoom-anim')) { return; } - if (_dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; } - _dragging = this; // Prevent dragging multiple objects at once. + if (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; } + Draggable._dragging = this; // Prevent dragging multiple objects at once. if (this._preventOutline) { DomUtil.preventOutline(this._element); @@ -222,7 +221,7 @@ export var Draggable = Evented.extend({ } this._moving = false; - _dragging = false; + Draggable._dragging = false; } });