[Pkg-javascript-commits] [leaflet] 66/301: Fix for iPad, where el.tagName was undefined when clicking on labels.

Jonas Smedegaard js at moszumanska.debian.org
Mon Jan 27 22:22:42 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 d78fb499435530f2d8178931084b716218adba42
Author: Dag Jomar Mersland <dagjomar at gmail.com>
Date:   Mon Aug 19 10:14:36 2013 +0200

    Fix for iPad, where el.tagName was undefined when clicking on labels.
---
 src/dom/Draggable.js       | 2 +-
 src/map/handler/Map.Tap.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js
index 5936297..48bb6cb 100644
--- a/src/dom/Draggable.js
+++ b/src/dom/Draggable.js
@@ -62,7 +62,7 @@ L.Draggable = L.Class.extend({
 		    el = first.target;
 
 		// if touching a link, highlight it
-		if (L.Browser.touch && el.tagName.toLowerCase() === 'a') {
+		if (L.Browser.touch && el.tagName && el.tagName.toLowerCase() === 'a') {
 			L.DomUtil.addClass(el, 'leaflet-active');
 		}
 
diff --git a/src/map/handler/Map.Tap.js b/src/map/handler/Map.Tap.js
index efd860e..54dbb0f 100644
--- a/src/map/handler/Map.Tap.js
+++ b/src/map/handler/Map.Tap.js
@@ -66,7 +66,7 @@ L.Map.Tap = L.Handler.extend({
 			var first = e.changedTouches[0],
 			    el = first.target;
 
-			if (el.tagName.toLowerCase() === 'a') {
+			if (el && el.tagName && el.tagName.toLowerCase() === 'a') {
 				L.DomUtil.removeClass(el, 'leaflet-active');
 			}
 

-- 
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