Browse code

Refactor and rewrite as contao bundle

Benjamin Roth authored on04/11/2022 22:32:32
Showing1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,43 +0,0 @@
1
-import { getWindow, getDocument } from 'ssr-window';
2
-var support;
3
-
4
-function calcSupport() {
5
-  var window = getWindow();
6
-  var document = getDocument();
7
-  return {
8
-    touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch),
9
-    pointerEvents: !!window.PointerEvent && 'maxTouchPoints' in window.navigator && window.navigator.maxTouchPoints >= 0,
10
-    observer: function checkObserver() {
11
-      return 'MutationObserver' in window || 'WebkitMutationObserver' in window;
12
-    }(),
13
-    passiveListener: function checkPassiveListener() {
14
-      var supportsPassive = false;
15
-
16
-      try {
17
-        var opts = Object.defineProperty({}, 'passive', {
18
-          // eslint-disable-next-line
19
-          get: function get() {
20
-            supportsPassive = true;
21
-          }
22
-        });
23
-        window.addEventListener('testPassiveListener', null, opts);
24
-      } catch (e) {// No support
25
-      }
26
-
27
-      return supportsPassive;
28
-    }(),
29
-    gestures: function checkGestures() {
30
-      return 'ongesturestart' in window;
31
-    }()
32
-  };
33
-}
34
-
35
-function getSupport() {
36
-  if (!support) {
37
-    support = calcSupport();
38
-  }
39
-
40
-  return support;
41
-}
42
-
43
-export { getSupport };
44 0
\ No newline at end of file
Browse code

swiper.js version 6.5.0

Benjamin Roth authored on14/03/2021 15:29:46
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,43 @@
1
+import { getWindow, getDocument } from 'ssr-window';
2
+var support;
3
+
4
+function calcSupport() {
5
+  var window = getWindow();
6
+  var document = getDocument();
7
+  return {
8
+    touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch),
9
+    pointerEvents: !!window.PointerEvent && 'maxTouchPoints' in window.navigator && window.navigator.maxTouchPoints >= 0,
10
+    observer: function checkObserver() {
11
+      return 'MutationObserver' in window || 'WebkitMutationObserver' in window;
12
+    }(),
13
+    passiveListener: function checkPassiveListener() {
14
+      var supportsPassive = false;
15
+
16
+      try {
17
+        var opts = Object.defineProperty({}, 'passive', {
18
+          // eslint-disable-next-line
19
+          get: function get() {
20
+            supportsPassive = true;
21
+          }
22
+        });
23
+        window.addEventListener('testPassiveListener', null, opts);
24
+      } catch (e) {// No support
25
+      }
26
+
27
+      return supportsPassive;
28
+    }(),
29
+    gestures: function checkGestures() {
30
+      return 'ongesturestart' in window;
31
+    }()
32
+  };
33
+}
34
+
35
+function getSupport() {
36
+  if (!support) {
37
+    support = calcSupport();
38
+  }
39
+
40
+  return support;
41
+}
42
+
43
+export { getSupport };
0 44
\ No newline at end of file