Don't use window and document

With this change, our JavaScript can also be executed by
non-brower engines.
This commit is contained in:
ahocevar
2013-04-10 15:48:17 +02:00
parent ee987bc951
commit dc1d7a1aba
2 changed files with 3 additions and 3 deletions

View File

@@ -16,6 +16,6 @@ ol.BrowserFeature = {
* @type {boolean}
*/
HAS_TOUCH: ol.ASSUME_TOUCH ||
(document && 'ontouchstart' in document.documentElement) ||
!!(window.navigator.msPointerEnabled)
(goog.global.document && 'ontouchstart' in document.documentElement) ||
!!(goog.global.navigator.msPointerEnabled)
};

View File

@@ -112,7 +112,7 @@ ol.Geolocation.prototype.handleTrackingChanged_ = function() {
* @const
* @type {boolean}
*/
ol.Geolocation.SUPPORTED = 'geolocation' in navigator;
ol.Geolocation.SUPPORTED = 'geolocation' in goog.global.navigator;
/**