lib/leaflet/src/layer/marker/Marker.Drag.js in leaflet-js-0.6.beta4 vs lib/leaflet/src/layer/marker/Marker.Drag.js in leaflet-js-0.7.0
- old
+ new
@@ -16,19 +16,21 @@
this._draggable
.on('dragstart', this._onDragStart, this)
.on('drag', this._onDrag, this)
.on('dragend', this._onDragEnd, this);
this._draggable.enable();
+ L.DomUtil.addClass(this._marker._icon, 'leaflet-marker-draggable');
},
removeHooks: function () {
this._draggable
- .off('dragstart', this._onDragStart)
- .off('drag', this._onDrag)
- .off('dragend', this._onDragEnd);
+ .off('dragstart', this._onDragStart, this)
+ .off('drag', this._onDrag, this)
+ .off('dragend', this._onDragEnd, this);
this._draggable.disable();
+ L.DomUtil.removeClass(this._marker._icon, 'leaflet-marker-draggable');
},
moved: function () {
return this._draggable && this._draggable._moved;
},
@@ -56,11 +58,11 @@
marker
.fire('move', {latlng: latlng})
.fire('drag');
},
- _onDragEnd: function () {
+ _onDragEnd: function (e) {
this._marker
.fire('moveend')
- .fire('dragend');
+ .fire('dragend', e);
}
});