@everymatrix/casino-slider 0.0.358 → 0.0.360

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": "0.0.358",
3
+ "version": "0.0.360",
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": "42389554d44d6e92badedce5312dc15f620f1568"
39
+ "gitHead": "bc9e5f5d2238b8300f8d4cb70890b2c1f0414b21"
40
40
  }
@@ -31,6 +31,7 @@
31
31
 
32
32
  let carousel:any;
33
33
  let activeIndex:number;
34
+ let prevIndex:number;
34
35
  let customStylingContainer:HTMLElement;
35
36
  let sliderdata:Array<any> = [];
36
37
 
@@ -39,6 +40,7 @@
39
40
  let handleClick = (item:any, index:number):void => {
40
41
  activeIndex = index;
41
42
  activeIndex = activeIndex;
43
+ prevIndex = activeIndex;
42
44
 
43
45
  window.postMessage({ type: actionevent, itemId: item.id, index, item }, window.location.href);
44
46
  };
@@ -59,6 +61,9 @@
59
61
 
60
62
  const setActiveIndex = ():void => {
61
63
  activeIndex = parseInt(activeindex, 10);
64
+ if(!prevIndex){
65
+ prevIndex = activeIndex;
66
+ }
62
67
  }
63
68
 
64
69
  const setClientStyling = ():void => {
@@ -113,11 +118,12 @@
113
118
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
114
119
  </svg>
115
120
  </div>
116
-
121
+
117
122
  <ul class="CarouselItems" part="CarouselItems" bind:this={carousel}>
118
123
  {#if sliderdata.length > 0}
119
124
  {#each sliderdata as item, index (item.id)}
120
- <li class="CarouselItem" part="CarouselItem" class:active={activeIndex == index} on:click={e => handleClick(item, index)}>
125
+ <li class="CarouselItem {activeIndex == index || prevIndex == index ? 'active': ''}" part="CarouselItem" on:click={e => handleClick(item, index)}
126
+ >
121
127
  {#if location === 'headerMain'}
122
128
  <a>{item.label}</a>
123
129
  {:else}