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
This commit is contained in:
Arne Schubert 2017-06-29 22:29:03 +02:00 committed by Per Liedman
parent d30f7aad35
commit 748f65f119
2 changed files with 2 additions and 2 deletions

View File

@ -245,7 +245,7 @@ export var Layers = Control.extend({
});
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);
}, this));
}

View File

@ -75,7 +75,7 @@ export var Draggable = Evented.extend({
// If we're currently dragging this draggable,
// disabling it counts as first ending the drag.
if (L.Draggable._dragging === this) {
if (_dragging === this) {
this.finishDrag();
}