@everymatrix/casino-slider 1.8.1 → 1.8.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-slider",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "main": "dist/casino-slider.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "e558ed5234cd858fa71696743229caa273752a2e"
39
+ "gitHead": "15df0a4bc1195017b7df65675dfd40261b5dbe8b"
40
40
  }
@@ -48,7 +48,7 @@
48
48
  let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
49
49
 
50
50
  let carousel:any;
51
- let activeIndex:number;
51
+ let activeIndex:any;
52
52
  let activeSubIndex:number;
53
53
  let prevIndex:number;
54
54
  let prevSubIndex:number;
@@ -97,8 +97,7 @@
97
97
  }
98
98
 
99
99
  const setActiveIndex = ():void => {
100
- activeIndex = parseInt(activeindex, 10);
101
- if (!prevIndex) {
100
+ if (!prevIndex || (prevIndex != activeIndex && activeIndex != -1)) {
102
101
  prevIndex = activeIndex;
103
102
  }
104
103
  }
@@ -246,7 +245,7 @@
246
245
  {#if sliderdata.length > 0}
247
246
 
248
247
  {#each sliderdata as category, index (category.id)}
249
- <li class="CarouselItem {activeIndex == index || prevIndex == index ? 'active': ''}
248
+ <li class="CarouselItem {activeindex.toString().indexOf('$') > -1 ? (activeindex.split("$").pop() == category.id.split("$").pop() ? 'active': '') : (activeindex == category.id ? 'active': '')}
250
249
  {location == 'headerMain' ? '' : 'SecondaryMenu'}"
251
250
  part="CarouselItem"
252
251
  on:click={e => { handleClick(category, index, null, null, 'main'); e.preventDefault()}}>