Click handler called with empty event object on Android

On Android (both native browser and Chrome), the handleTouchEnd_
method is sometimes reached in a state where this.down_ is null.
This check protects against this.click_ being called without
an event object. To see this issue, open any example in Android,
and tap the zoom + or - button.
This commit is contained in:
ahocevar
2013-06-24 10:35:02 +02:00
parent b30dcdd35a
commit a405279f34
+2
View File
@@ -373,8 +373,10 @@ ol.MapBrowserEventHandler.prototype.handleTouchEnd_ = function(browserEvent) {
} else { } else {
this.timestamp_ = 0; this.timestamp_ = 0;
} }
if (!goog.isNull(this.down_)) {
this.click_(this.down_); this.click_(this.down_);
} }
}
this.down_ = null; this.down_ = null;
}; };