goog.require creates a namespace object already

This commit is contained in:
Éric Lemoine
2013-12-18 08:16:13 +01:00
parent 1b084dba06
commit 73f24cf7b0
+8 -8
View File
@@ -7,23 +7,23 @@ goog.provide('ol.BrowserFeature');
ol.ASSUME_TOUCH = false; ol.ASSUME_TOUCH = false;
/**
* @type {Object}
*/
ol.BrowserFeature = {
/** /**
* The ratio between physical pixels and device-independent pixels * The ratio between physical pixels and device-independent pixels
* (dips) on the device (`window.devicePixelRatio`). * (dips) on the device (`window.devicePixelRatio`).
* @const
* @type {number} * @type {number}
* @todo stability experimental
*/ */
DEVICE_PIXEL_RATIO: goog.global.devicePixelRatio || 1, ol.BrowserFeature.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1;
/** /**
* True if browser supports touch events. * True if browser supports touch events.
* @const
* @type {boolean} * @type {boolean}
* @todo stability experimental
*/ */
HAS_TOUCH: ol.ASSUME_TOUCH || ol.BrowserFeature.HAS_TOUCH = ol.ASSUME_TOUCH ||
(goog.global.document && (goog.global.document &&
'ontouchstart' in goog.global.document.documentElement) || 'ontouchstart' in goog.global.document.documentElement) ||
!!(goog.global.navigator.msPointerEnabled) !!(goog.global.navigator.msPointerEnabled);
};