@everymatrix/casino-header-controller 0.0.236 → 0.0.240
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-header-controller",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.240",
|
|
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": "
|
|
41
|
+
"gitHead": "6b0a5bd921101009e1bbfaa3fe63215a87fffc40"
|
|
42
42
|
}
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
export let endpoint:string = '';
|
|
18
18
|
export let cmsendpoint:string = '';
|
|
19
19
|
export let cmsenv:string = 'stage';
|
|
20
|
-
export let lang:string = '';
|
|
21
|
-
export let languageslist:string = 'en,ro';
|
|
20
|
+
export let lang:string = 'en';
|
|
21
|
+
export let languageslist:string = 'en, ro';
|
|
22
22
|
export let activecategory:string = '';
|
|
23
23
|
|
|
24
24
|
export let operatorid:string = '';
|
|
@@ -61,14 +61,15 @@
|
|
|
61
61
|
let loginActive:boolean = true;
|
|
62
62
|
let language:string = '';
|
|
63
63
|
let languagesArray:Array<string> = [];
|
|
64
|
-
// use for medium devices styling, if necessary
|
|
65
|
-
// const mediaQuery = window.matchMedia('(min-width: 768px)');
|
|
66
64
|
let hamburgerMenuActive:boolean = false;
|
|
67
65
|
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
let fallbackSecondaryMenu = [
|
|
67
|
+
{
|
|
68
|
+
"id": 0,
|
|
69
|
+
"label": $_('fallbackSecondaryMenu.promotions'),
|
|
70
|
+
"path": "/promotions",
|
|
71
|
+
}
|
|
72
|
+
];
|
|
72
73
|
|
|
73
74
|
const menuAction = (data: any) => {
|
|
74
75
|
switch (data) {
|
|
@@ -157,14 +158,10 @@
|
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
const initialLoad = ():void => {
|
|
160
|
-
|
|
161
|
-
languagesArray =
|
|
162
|
-
|
|
163
|
-
languagesArray[index] = languageItem.toUpperCase();
|
|
164
|
-
})
|
|
165
|
-
|
|
161
|
+
languagesArray = languageslist.replace(/ /g,'').split(',');
|
|
162
|
+
languagesArray = languagesArray.map((language:string) => language.toUpperCase());
|
|
163
|
+
|
|
166
164
|
selectedLanguage = lang.toUpperCase();
|
|
167
|
-
|
|
168
165
|
createCMSUrls();
|
|
169
166
|
|
|
170
167
|
getHeaderMenusData(headerURL);
|
|
@@ -187,6 +184,9 @@
|
|
|
187
184
|
.then((data: any) => {
|
|
188
185
|
mainMenuArray = data.desktop.primary;
|
|
189
186
|
secondaryMenuArray = data.desktop.secondary;
|
|
187
|
+
if( !secondaryMenuArray.length ) {
|
|
188
|
+
secondaryMenuArray = fallbackSecondaryMenu;
|
|
189
|
+
}
|
|
190
190
|
isLoading = false;
|
|
191
191
|
|
|
192
192
|
resolve(data);
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
|
|
275
275
|
<nav class="HeaderMainNav">
|
|
276
276
|
{#if !isLoading}
|
|
277
|
-
<casino-slider class="HeaderItemsMenu" {identity} use:sendSliderData {actionevent} activeindex={activeIndex} location="headerMain"/>
|
|
277
|
+
<casino-slider class="HeaderItemsMenu" {identity} use:sendSliderData isprimarymenu=true {actionevent} activeindex={activeIndex} location="headerMain"/>
|
|
278
278
|
{/if}
|
|
279
279
|
</nav>
|
|
280
280
|
<div class="HeaderTopActions">
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
</div>
|
|
299
299
|
<select bind:value={selectedLanguage} class="Item ItemLanguage" on:change={()=>menuAction('language')}>
|
|
300
300
|
{#each languagesArray as operatorLanguage}
|
|
301
|
-
<option value={operatorLanguage}>{operatorLanguage}</option>
|
|
301
|
+
<option value={operatorLanguage} selected>{operatorLanguage}</option>
|
|
302
302
|
{/each}
|
|
303
303
|
</select>
|
|
304
304
|
</div>
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
|
|
355
355
|
<nav class="HeaderMainNav">
|
|
356
356
|
{#if !isLoading}
|
|
357
|
-
<casino-slider class="HeaderItemsMenu" {identity} use:sendSliderData {actionevent} activeindex={activeIndex} location="headerMain"/>
|
|
357
|
+
<casino-slider class="HeaderItemsMenu" {identity} use:sendSliderData isprimarymenu=true {actionevent} activeindex={activeIndex} location="headerMain"/>
|
|
358
358
|
{/if}
|
|
359
359
|
</nav>
|
|
360
360
|
<div class="HeaderTopActions">
|
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
{/if}
|
|
381
381
|
{/if}
|
|
382
382
|
|
|
383
|
-
<casino-hamburger-menu menuitemsurl={hamburgerURL} {activecategory} {
|
|
383
|
+
<casino-hamburger-menu menuitemsurl={hamburgerURL} {activecategory} {lang} {languageslist}></casino-hamburger-menu>
|
|
384
384
|
|
|
385
385
|
<style lang="scss">
|
|
386
386
|
//This function does a multiplication
|
package/src/translations.js
CHANGED
|
@@ -4,6 +4,9 @@ export const CasinoHeaderController = {
|
|
|
4
4
|
login: 'Login',
|
|
5
5
|
register: 'Register',
|
|
6
6
|
deposit: 'Deposit',
|
|
7
|
+
},
|
|
8
|
+
fallbackSecondaryMenu: {
|
|
9
|
+
promotions: 'Promotions',
|
|
7
10
|
}
|
|
8
11
|
},
|
|
9
12
|
tr: {
|
|
@@ -11,6 +14,9 @@ export const CasinoHeaderController = {
|
|
|
11
14
|
login: 'Giriş yapmak',
|
|
12
15
|
register: 'Kayıt olmak',
|
|
13
16
|
deposit: 'Depozito',
|
|
17
|
+
},
|
|
18
|
+
fallbackSecondaryMenu: {
|
|
19
|
+
promotions: 'Promosyonlar',
|
|
14
20
|
}
|
|
15
21
|
},
|
|
16
22
|
ro: {
|
|
@@ -18,6 +24,9 @@ export const CasinoHeaderController = {
|
|
|
18
24
|
login: 'Autentificare',
|
|
19
25
|
register: 'Inregistreaza-te',
|
|
20
26
|
deposit: 'Depozit',
|
|
27
|
+
},
|
|
28
|
+
fallbackSecondaryMenu: {
|
|
29
|
+
promotions: 'Promotii',
|
|
21
30
|
}
|
|
22
31
|
},
|
|
23
32
|
};
|