welsonjs/node_modules/modernizr/feature-detects/event/deviceorientation-motion.js

29 lines
943 B
JavaScript

/*!
{
"name": "Orientation and Motion Events",
"property": ["devicemotion", "deviceorientation"],
"caniuse": "deviceorientation",
"notes": [{
"name": "W3C Editor's Draft Spec",
"href": "https://w3c.github.io/deviceorientation/"
}, {
"name": "MDN Docs",
"href": "https://developer.mozilla.org/en-US/docs/Web/API/Detecting_device_orientation"
}],
"authors": ["Shi Chuan"],
"tags": ["event"],
"builderAliases": ["event_deviceorientation_motion"]
}
!*/
/* DOC
Part of Device Access aspect of HTML5, same category as geolocation.
`devicemotion` tests for Device Motion Event support, returns boolean value true/false.
`deviceorientation` tests for Device Orientation Event support, returns boolean value true/false
*/
define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('devicemotion', 'DeviceMotionEvent' in window);
Modernizr.addTest('deviceorientation', 'DeviceOrientationEvent' in window);
});