work with handlers in right place
This commit is contained in:
parent
71167baa52
commit
1df4c4a98f
@ -37,10 +37,6 @@ L.Draggable = L.Class.extend({
|
||||
|
||||
disable: function () {
|
||||
if (!this._enabled) { return; }
|
||||
|
||||
this.off('dragstart', this._onDragStart)
|
||||
.off('drag', this._onDrag)
|
||||
.off('dragend', this._onDragEnd);
|
||||
|
||||
for (var i = L.Draggable.START.length - 1; i >= 0; i--) {
|
||||
L.DomEvent.off(this._dragStartTarget, L.Draggable.START[i], this._onDown, this);
|
||||
|
@ -19,6 +19,11 @@ L.Handler.MarkerDrag = L.Handler.extend({
|
||||
},
|
||||
|
||||
removeHooks: function () {
|
||||
this._draggable
|
||||
.off('dragstart', this._onDragStart)
|
||||
.off('drag', this._onDrag)
|
||||
.off('dragend', this._onDragEnd);
|
||||
|
||||
this._draggable.disable();
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user