[Pkg-javascript-commits] [leaflet] 258/301: IE doesn't support e.target, use srcElement.

Jonas Smedegaard js at moszumanska.debian.org
Mon Jan 27 22:22:55 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet.

commit b2959b448859c1cb89d435b6b4c5bf7cabdc0016
Author: danzel <danzel at localhost.geek.nz>
Date:   Fri Nov 15 10:16:42 2013 +1300

    IE doesn't support e.target, use srcElement.
    
    http://stackoverflow.com/questions/1143196/ie-e-target-id-is-not-working
---
 src/dom/Draggable.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js
index fb451b9..65b2ae0 100644
--- a/src/dom/Draggable.js
+++ b/src/dom/Draggable.js
@@ -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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet.git



More information about the Pkg-javascript-commits mailing list