@total_onion/onion-library 1.1.21 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ import extraJs from 'Assets/js/blocks/carousel-multi-layout-v3/carousel-multi-la
4
4
  export default function carouselmultilayoutv3Js(options = {}) {
5
5
  try {
6
6
  const {block} = options;
7
+ const totalSlides = block.querySelector('.swiper-slide') || 1;
7
8
  Promise.all([getSwiperAssetsV2()]).then((values) => {
8
9
  const {
9
10
  Swiper,
@@ -110,7 +111,6 @@ export default function carouselmultilayoutv3Js(options = {}) {
110
111
  );
111
112
  }
112
113
  : false;
113
- // console.log(paginationStyle);
114
114
  const carouselmultilayoutv3Swiper = new Swiper(
115
115
  block.querySelector('.swiper'),
116
116
  {
@@ -127,7 +127,7 @@ export default function carouselmultilayoutv3Js(options = {}) {
127
127
  ],
128
128
  slidesPerView: slidesMobile,
129
129
  spaceBetween: spaceBetweenSlidesMobile,
130
- loop: loopSlidesMobile,
130
+ loop: totalSlides > 1 ? loopSlidesMobile : false,
131
131
  preloadImages: true,
132
132
  watchSlidesVisibility: true,
133
133
  effect: transitionStyle,
@@ -179,7 +179,7 @@ export default function carouselmultilayoutv3Js(options = {}) {
179
179
 
180
180
  slidesOffsetBefore: slidesOffsetTabletBefore,
181
181
  slidesOffsetAfter: slidesOffsetTabletAfter,
182
- loop: loopSlidesPortrait
182
+ loop: totalSlides > 1 ? loopSlidesPortrait : false
183
183
  },
184
184
  1024: {
185
185
  slidesPerView: slidesDesktop,
@@ -189,7 +189,7 @@ export default function carouselmultilayoutv3Js(options = {}) {
189
189
  centerInsufficientSlidesDesktop,
190
190
  slidesOffsetBefore: slidesOffsetDesktopBefore,
191
191
  slidesOffsetAfter: slidesOffsetDesktopAfter,
192
- loop: loopSlides
192
+ loop: totalSlides > 1 ? loopSlides : false
193
193
  }
194
194
  },
195
195
  navigation: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@total_onion/onion-library",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {