Prevent using functions from the global scope with es6 (#5596)

* Prevent using functions from the global scope with es6

* check against static _dragging as requested by perliedman
carto
Arne Schubert 7 years ago committed by Per Liedman
parent d30f7aad35
commit 748f65f119

@ -245,7 +245,7 @@ export var Layers = Control.extend({
}); });
if (this.options.sortLayers) { if (this.options.sortLayers) {
this._layers.sort(L.bind(function (a, b) { this._layers.sort(Util.bind(function (a, b) {
return this.options.sortFunction(a.layer, b.layer, a.name, b.name); return this.options.sortFunction(a.layer, b.layer, a.name, b.name);
}, this)); }, this));
} }

@ -75,7 +75,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 (L.Draggable._dragging === this) { if (_dragging === this) {
this.finishDrag(); this.finishDrag();
} }

Loading…
Cancel
Save