Fix for iPad, where el.tagName was undefined when clicking on labels.

This commit is contained in:
Dag Jomar Mersland 2013-08-19 10:14:36 +02:00 committed by Ole Markus With
parent 1f6533d0f5
commit d78fb49943
2 changed files with 2 additions and 2 deletions

View File

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

View File

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