IE doesn't support e.target, use srcElement.

http://stackoverflow.com/questions/1143196/ie-e-target-id-is-not-working
This commit is contained in:
danzel 2013-11-15 10:16:42 +13:00
parent 81ae1794d3
commit b2959b4488

View File

@ -92,7 +92,7 @@ L.Draggable = L.Class.extend({
this._startPos = L.DomUtil.getPosition(this._element).subtract(offset);
L.DomUtil.addClass(document.body, 'leaflet-dragging');
L.DomUtil.addClass(e.target, 'leaflet-drag-target');
L.DomUtil.addClass((e.target || e.srcElement), 'leaflet-drag-target');
}
this._newPos = this._startPos.add(offset);
@ -110,7 +110,7 @@ L.Draggable = L.Class.extend({
_onUp: function (e) {
L.DomUtil.removeClass(document.body, 'leaflet-dragging');
L.DomUtil.removeClass(e.target, 'leaflet-drag-target');
L.DomUtil.removeClass((e.target || e.srcElement), 'leaflet-drag-target');
for (var i in L.Draggable.MOVE) {
L.DomEvent