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,34 +0,0 @@
1
-function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
-import { h } from 'vue';
4
-
5
-function updateOnVirtualData(swiper) {
6
-  if (!swiper || swiper.destroyed || !swiper.params.virtual || swiper.params.virtual && !swiper.params.virtual.enabled) return;
7
-  swiper.updateSlides();
8
-  swiper.updateProgress();
9
-  swiper.updateSlidesClasses();
10
-
11
-  if (swiper.lazy && swiper.params.lazy.enabled) {
12
-    swiper.lazy.load();
13
-  }
14
-}
15
-
16
-function renderVirtual(swiperRef, slides, virtualData) {
17
-  var _ref;
18
-
19
-  if (!virtualData) return null;
20
-  var style = swiperRef.value.isHorizontal() ? (_ref = {}, _ref[swiperRef.value.rtlTranslate ? 'right' : 'left'] = virtualData.offset + "px", _ref) : {
21
-    top: virtualData.offset + "px"
22
-  };
23
-  return slides.filter(function (slide, index) {
24
-    return index >= virtualData.from && index <= virtualData.to;
25
-  }).map(function (slide) {
26
-    if (!slide.props) slide.props = {};
27
-    if (!slide.props.style) slide.props.style = {};
28
-    slide.props.swiperRef = swiperRef;
29
-    slide.props.style = style;
30
-    return h(slide.type, _extends({}, slide.props), slide.children);
31
-  });
32
-}
33
-
34
-export { renderVirtual, updateOnVirtualData };
35 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,34 @@
1
+function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+import { h } from 'vue';
4
+
5
+function updateOnVirtualData(swiper) {
6
+  if (!swiper || swiper.destroyed || !swiper.params.virtual || swiper.params.virtual && !swiper.params.virtual.enabled) return;
7
+  swiper.updateSlides();
8
+  swiper.updateProgress();
9
+  swiper.updateSlidesClasses();
10
+
11
+  if (swiper.lazy && swiper.params.lazy.enabled) {
12
+    swiper.lazy.load();
13
+  }
14
+}
15
+
16
+function renderVirtual(swiperRef, slides, virtualData) {
17
+  var _ref;
18
+
19
+  if (!virtualData) return null;
20
+  var style = swiperRef.value.isHorizontal() ? (_ref = {}, _ref[swiperRef.value.rtlTranslate ? 'right' : 'left'] = virtualData.offset + "px", _ref) : {
21
+    top: virtualData.offset + "px"
22
+  };
23
+  return slides.filter(function (slide, index) {
24
+    return index >= virtualData.from && index <= virtualData.to;
25
+  }).map(function (slide) {
26
+    if (!slide.props) slide.props = {};
27
+    if (!slide.props.style) slide.props.style = {};
28
+    slide.props.swiperRef = swiperRef;
29
+    slide.props.style = style;
30
+    return h(slide.type, _extends({}, slide.props), slide.children);
31
+  });
32
+}
33
+
34
+export { renderVirtual, updateOnVirtualData };
0 35
\ No newline at end of file