work with handlers in right place

This commit is contained in:
snkashis 2013-02-28 11:01:26 +00:00
parent 71167baa52
commit 1df4c4a98f
2 changed files with 5 additions and 4 deletions

View File

@ -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);

View File

@ -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();
},