Merge pull request #1040 from fredj/goog_global

Use goog.global instead of window
This commit is contained in:
Frédéric Junod
2013-09-19 06:46:34 -07:00
+2 -2
View File
@@ -105,7 +105,7 @@ ol.DeviceOrientation.prototype.disposeInternal = function() {
* @const * @const
* @type {boolean} * @type {boolean}
*/ */
ol.DeviceOrientation.SUPPORTED = 'DeviceOrientationEvent' in window; ol.DeviceOrientation.SUPPORTED = 'DeviceOrientationEvent' in goog.global;
goog.exportProperty( goog.exportProperty(
ol.DeviceOrientation, ol.DeviceOrientation,
'SUPPORTED', 'SUPPORTED',
@@ -220,7 +220,7 @@ ol.DeviceOrientation.prototype.handleTrackingChanged_ = function() {
if (ol.DeviceOrientation.SUPPORTED) { if (ol.DeviceOrientation.SUPPORTED) {
var tracking = this.getTracking(); var tracking = this.getTracking();
if (tracking && goog.isNull(this.listenerKey_)) { if (tracking && goog.isNull(this.listenerKey_)) {
this.listenerKey_ = goog.events.listen(window, '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 && !goog.isNull(this.listenerKey_)) {
goog.events.unlistenByKey(this.listenerKey_); goog.events.unlistenByKey(this.listenerKey_);