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,31 +0,0 @@
1
-import React from 'react';
2
-
3
-function updateOnVirtualData(swiper) {
4
-  if (!swiper || swiper.destroyed) return;
5
-  swiper.updateSlides();
6
-  swiper.updateProgress();
7
-  swiper.updateSlidesClasses();
8
-
9
-  if (swiper.lazy && swiper.params.lazy.enabled) {
10
-    swiper.lazy.load();
11
-  }
12
-}
13
-
14
-function renderVirtual(swiper, slides, virtualData) {
15
-  var _ref;
16
-
17
-  if (!virtualData) return null;
18
-  var style = swiper.isHorizontal() ? (_ref = {}, _ref[swiper.rtlTranslate ? 'right' : 'left'] = virtualData.offset + "px", _ref) : {
19
-    top: virtualData.offset + "px"
20
-  };
21
-  return slides.filter(function (child, index) {
22
-    return index >= virtualData.from && index <= virtualData.to;
23
-  }).map(function (child) {
24
-    return React.cloneElement(child, {
25
-      swiper: swiper,
26
-      style: style
27
-    });
28
-  });
29
-}
30
-
31
-export { renderVirtual, updateOnVirtualData };
32 0
\ No newline at end of file
Browse code

swiper.js version 6.3.3

Benjamin Roth authored on13/10/2020 19:31:56
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,31 @@
1
+import React from 'react';
2
+
3
+function updateOnVirtualData(swiper) {
4
+  if (!swiper || swiper.destroyed) return;
5
+  swiper.updateSlides();
6
+  swiper.updateProgress();
7
+  swiper.updateSlidesClasses();
8
+
9
+  if (swiper.lazy && swiper.params.lazy.enabled) {
10
+    swiper.lazy.load();
11
+  }
12
+}
13
+
14
+function renderVirtual(swiper, slides, virtualData) {
15
+  var _ref;
16
+
17
+  if (!virtualData) return null;
18
+  var style = swiper.isHorizontal() ? (_ref = {}, _ref[swiper.rtlTranslate ? 'right' : 'left'] = virtualData.offset + "px", _ref) : {
19
+    top: virtualData.offset + "px"
20
+  };
21
+  return slides.filter(function (child, index) {
22
+    return index >= virtualData.from && index <= virtualData.to;
23
+  }).map(function (child) {
24
+    return React.cloneElement(child, {
25
+      swiper: swiper,
26
+      style: style
27
+    });
28
+  });
29
+}
30
+
31
+export { renderVirtual, updateOnVirtualData };
0 32
\ No newline at end of file