@everymatrix/casino-header-controller 1.8.4 → 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
package/index.html CHANGED
@@ -26,8 +26,8 @@
26
26
  cmsendpoint="https://widgets.everymatrix.com/apijson"
27
27
  lang="en"
28
28
  showbanner="true"
29
- session=""
30
- userid=""
29
+ session="ff9b00eb-2782-44fc-b4e1-fc9b3c91ecb6"
30
+ userid="4506648"
31
31
  profileurl=''
32
32
  endpoint="https://demo-api.stage.norway.everymatrix.com/v1"
33
33
  bannermatrix="https://bannermatrix-stage.everymatrix.com"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-header-controller",
3
- "version": "1.8.4",
3
+ "version": "1.9.1",
4
4
  "main": "dist/casino-header-controller.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "58b0374c9527cbfb3a070ac6fb1744bc670aba27"
41
+ "gitHead": "b882819d6bf435954793bf62ec04879ecb8572e0"
42
42
  }
@@ -20,6 +20,7 @@
20
20
  export let languageslist:string = 'en, ro';
21
21
  export let activecategory:string = '';
22
22
  export let translationurl:string = '';
23
+ export let customlocaleidentifier:string = '';
23
24
 
24
25
  export let operatorid:string = '';
25
26
  export let pagetag:string = '';
@@ -225,8 +226,14 @@
225
226
  }
226
227
 
227
228
  const setActiveIndex = ():void => {
228
- activeIndex = mainMenuArray.find(item => item.path.indexOf(activecategory.split('/')[1]) > -1)?.id;
229
-
229
+ activeIndex = mainMenuArray.find(item => {
230
+ if ( activecategory.indexOf('/sport') > -1 ) {
231
+ return item.path.indexOf(activecategory) > -1
232
+ } else {
233
+ //Opted for this solution so that when you go back from casino categories slider it will change the active index when its required from header too
234
+ return item.path.indexOf(activecategory.split('/')[1]) > -1
235
+ }
236
+ })?.id;
230
237
  }
231
238
 
232
239
  const sendSliderData = ():void => {
@@ -275,6 +282,10 @@
275
282
  });
276
283
  }
277
284
 
285
+ const navigationTrigger = (itemData:any) => {
286
+ window.postMessage({ type: actionevent, itemId: itemData.id, item: itemData, externalLink: itemData.externalLink, target: itemData.attrs?.target || null }, window.location.href);
287
+ }
288
+
278
289
  const setClientStyling = ():void => {
279
290
  let sheet = document.createElement('style');
280
291
  sheet.innerHTML = clientstyling;
@@ -347,7 +358,7 @@
347
358
 
348
359
  <div class="HeaderTopActions" part="HeaderTopActions">
349
360
  <div class="HeaderItemsMenu PrimaryMenu" part="HeaderItemsMenu PrimaryMenu">
350
- <player-account-balance-modal {session} {userid} {endpoint} {lang} {clientstyling} {clientstylingurl}/>
361
+ <player-account-balance-modal {session} {userid} {endpoint} {lang} {clientstyling} {clientstylingurl} {customlocaleidentifier}/>
351
362
  <div class="Item ItemDeposit" part="Item ItemDeposit" on:click={() => menuAction('deposit')}>{$_('headerItem.deposit')}</div>
352
363
  <div class="Item ItemAccount" part="Item ItemAccount" on:click={() => menuAction('myaccount')}>
353
364
  <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16.429" viewBox="0 0 15 16.429">
@@ -400,7 +411,7 @@
400
411
  </nav>
401
412
  <div class="HeaderTopActions" part="HeaderItemsMenu">
402
413
  <div class="HeaderItemsMenu PrimaryMenu" part="HeaderItemsMenu PrimaryMenu">
403
- <player-account-balance-modal {session} {userid} {endpoint} {lang} {clientstyling} {clientstylingurl}/>
414
+ <player-account-balance-modal {session} {userid} {endpoint} {lang} {clientstyling} {clientstylingurl} {customlocaleidentifier}/>
404
415
  <div class="Item ItemDeposit" part="Item ItemDeposit" on:click={() => menuAction('deposit')}>{$_('headerItem.deposit')}</div>
405
416
  <div class="Item ItemAccount" part="Item ItemAccount" on:click={() => menuAction('myaccount')}>
406
417
  <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16.429" viewBox="0 0 15 16.429">
@@ -428,7 +439,9 @@
428
439
  <nav class="HeaderSecondaryNav" part="HeaderSecondaryNav">
429
440
  <ul class="HeaderItemsMenuSecondary" part="HeaderItemsMenuSecondary">
430
441
  {#each secondaryMenuArray as secondaryItem}
431
- <li class="ItemSecondary" part="ItemSecondary"><a href={secondaryItem.path}>{secondaryItem.label}</a></li>
442
+ <li class="ItemSecondary" part="ItemSecondary">
443
+ <button on:click={() => navigationTrigger(secondaryItem)}>{secondaryItem.label}</button>
444
+ </li>
432
445
  {/each}
433
446
  </ul>
434
447
  </nav>
@@ -514,7 +527,9 @@
514
527
  <nav class="HeaderSecondaryNav" part="HeaderSecondaryNav">
515
528
  <ul class="HeaderItemsMenuSecondary" part="HeaderItemsMenuSecondary">
516
529
  {#each secondaryMenuArray as secondaryItem}
517
- <li class="ItemSecondary" part="ItemSecondary"><a href={secondaryItem.path}>{secondaryItem.label}</a></li>
530
+ <li class="ItemSecondary" part="ItemSecondary">
531
+ <button on:click={() => navigationTrigger(secondaryItem)}>{secondaryItem.label}</button>
532
+ </li>
518
533
  {/each}
519
534
  </ul>
520
535
  </nav>
@@ -702,13 +717,18 @@
702
717
  font-weight: 600;
703
718
  transition-duration: 0.15s;
704
719
 
705
- a {
720
+ button {
706
721
  color: var(--emfe-w-color-white, #FFFFFF);
707
722
  text-decoration: none;
723
+ border: none;
724
+ background: none;
725
+ font-size: 14px;
726
+ font-weight: 600;
727
+ text-transform: uppercase;
708
728
  }
709
729
 
710
730
  &:hover {
711
- a {
731
+ button {
712
732
  color: var(--emfe-w-color-primary, #D0046C);
713
733
  }
714
734
  }