Remove goog.isNull in deviceorientation class

This commit is contained in:
Marc Jansen
2015-09-29 15:22:26 +02:00
parent 3552f5ff66
commit e65384a407
+2 -2
View File
@@ -208,10 +208,10 @@ ol.DeviceOrientation.prototype.getTracking = function() {
ol.DeviceOrientation.prototype.handleTrackingChanged_ = function() { ol.DeviceOrientation.prototype.handleTrackingChanged_ = function() {
if (ol.has.DEVICE_ORIENTATION) { if (ol.has.DEVICE_ORIENTATION) {
var tracking = this.getTracking(); var tracking = this.getTracking();
if (tracking && goog.isNull(this.listenerKey_)) { if (tracking && !this.listenerKey_) {
this.listenerKey_ = goog.events.listen(goog.global, 'deviceorientation', this.listenerKey_ = goog.events.listen(goog.global, 'deviceorientation',
this.orientationChange_, false, this); this.orientationChange_, false, this);
} else if (!tracking && !goog.isNull(this.listenerKey_)) { } else if (!tracking && this.listenerKey_) {
goog.events.unlistenByKey(this.listenerKey_); goog.events.unlistenByKey(this.listenerKey_);
this.listenerKey_ = null; this.listenerKey_ = null;
} }