1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports.getSupport = getSupport;
|
5 |
|
6 | var _ssrWindow = require("ssr-window");
|
7 |
|
8 | var support;
|
9 |
|
10 | function calcSupport() {
|
11 | var window = (0, _ssrWindow.getWindow)();
|
12 | var document = (0, _ssrWindow.getDocument)();
|
13 | return {
|
14 | touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch),
|
15 | pointerEvents: !!window.PointerEvent && 'maxTouchPoints' in window.navigator && window.navigator.maxTouchPoints >= 0,
|
16 | observer: function checkObserver() {
|
17 | return 'MutationObserver' in window || 'WebkitMutationObserver' in window;
|
18 | }(),
|
19 | passiveListener: function checkPassiveListener() {
|
20 | var supportsPassive = false;
|
21 |
|
22 | try {
|
23 | var opts = Object.defineProperty({}, 'passive', {
|
24 |
|
25 | get: function get() {
|
26 | supportsPassive = true;
|
27 | }
|
28 | });
|
29 | window.addEventListener('testPassiveListener', null, opts);
|
30 | } catch (e) {
|
31 | }
|
32 |
|
33 | return supportsPassive;
|
34 | }(),
|
35 | gestures: function checkGestures() {
|
36 | return 'ongesturestart' in window;
|
37 | }()
|
38 | };
|
39 | }
|
40 |
|
41 | function getSupport() {
|
42 | if (!support) {
|
43 | support = calcSupport();
|
44 | }
|
45 |
|
46 | return support;
|
47 | } |
\ | No newline at end of file |