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

View File

@@ -208,10 +208,10 @@ ol.DeviceOrientation.prototype.getTracking = function() {
ol.DeviceOrientation.prototype.handleTrackingChanged_ = function() {
if (ol.has.DEVICE_ORIENTATION) {
var tracking = this.getTracking();
if (tracking && goog.isNull(this.listenerKey_)) {
if (tracking && !this.listenerKey_) {
this.listenerKey_ = goog.events.listen(goog.global, 'deviceorientation',
this.orientationChange_, false, this);
} else if (!tracking && !goog.isNull(this.listenerKey_)) {
} else if (!tracking && this.listenerKey_) {
goog.events.unlistenByKey(this.listenerKey_);
this.listenerKey_ = null;
}