@worksafevictoria/wcl7.5 1.8.0-beta.4 → 1.8.0-beta.6
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/lib/utility.js +2 -0
- package/package.json +1 -1
- package/src/components/Common/CardGrid/index.vue +1 -0
- package/src/components/Common/CardGridItem/index.vue +1 -1
- package/src/components/Global/AppHeader/index.vue +194 -284
- package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +31 -22
- package/src/components/SubComponents/Search/SearchListing/index.vue +24 -21
- package/src/components/SubComponents/Search/index.stories.js +2 -1
- package/src/components/SubComponents/Search/index.vue +3 -3
package/lib/utility.js
CHANGED
|
@@ -35,6 +35,8 @@ function isGovSite(url) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function navigateToPath(path, newTab, nuxtRouter) {
|
|
38
|
+
debugger
|
|
39
|
+
|
|
38
40
|
const url = String(path).startsWith('www.') ? `http://${path}` : path
|
|
39
41
|
const isAbsolute = isAbsoluteUrl(url)
|
|
40
42
|
const router = nuxtRouter ? nuxtRouter : this.$router
|
package/package.json
CHANGED
|
@@ -13,11 +13,7 @@
|
|
|
13
13
|
>
|
|
14
14
|
<nuxt-link class="dark" to="/">
|
|
15
15
|
<img
|
|
16
|
-
:alt="
|
|
17
|
-
isWorkWell
|
|
18
|
-
? 'Work Well Victoria - Logo'
|
|
19
|
-
: 'Work Safe Victoria - Logo'
|
|
20
|
-
"
|
|
16
|
+
:alt="isWorkWell ? 'Work Well Victoria - Logo' : 'Work Safe Victoria - Logo'"
|
|
21
17
|
width="127"
|
|
22
18
|
height="55"
|
|
23
19
|
:src="isWorkWell ? WorkWellLogo : WorkSafeLogo"
|
|
@@ -50,7 +46,7 @@
|
|
|
50
46
|
@keydown.tab="submenuFocus"
|
|
51
47
|
>
|
|
52
48
|
<caret-left />
|
|
53
|
-
{{ isThirdLevelOpen ? firstLevelItemName :
|
|
49
|
+
{{ isThirdLevelOpen ? firstLevelItemName : "Main menu" }}
|
|
54
50
|
</button>
|
|
55
51
|
</div>
|
|
56
52
|
<nav
|
|
@@ -73,10 +69,7 @@
|
|
|
73
69
|
role="button"
|
|
74
70
|
aria-expanded="false"
|
|
75
71
|
@click.prevent="
|
|
76
|
-
firstLevelClick(
|
|
77
|
-
firstLevelLink,
|
|
78
|
-
`firstLevelMenuItem-${parentIndex}`,
|
|
79
|
-
)
|
|
72
|
+
firstLevelClick(firstLevelLink, `firstLevelMenuItem-${parentIndex}`)
|
|
80
73
|
"
|
|
81
74
|
@mouseover="mouseHover('firstLevelMenuItem', parentIndex)"
|
|
82
75
|
@mouseleave="mouseLeave('firstLevelMenuItem', parentIndex)"
|
|
@@ -114,8 +107,7 @@
|
|
|
114
107
|
<div
|
|
115
108
|
class="sub-nav-container__wrap"
|
|
116
109
|
:class="{
|
|
117
|
-
'styled-scrollbar':
|
|
118
|
-
screen === 'mobile' && isSecondLevelOpen,
|
|
110
|
+
'styled-scrollbar': screen === 'mobile' && isSecondLevelOpen,
|
|
119
111
|
}"
|
|
120
112
|
>
|
|
121
113
|
<div
|
|
@@ -137,9 +129,7 @@
|
|
|
137
129
|
<div class="selected-items">
|
|
138
130
|
<ul v-if="firstLevelLink.below" class="sub-nav-group">
|
|
139
131
|
<li
|
|
140
|
-
v-for="(
|
|
141
|
-
secondLevelLink, secondIndex
|
|
142
|
-
) in firstLevelLink.below"
|
|
132
|
+
v-for="(secondLevelLink, secondIndex) in firstLevelLink.below"
|
|
143
133
|
:key="secondLevelLink.key"
|
|
144
134
|
:ref="`secondLevelMenuItem-${parentIndex}-${secondIndex}`"
|
|
145
135
|
class="sub-nav-parent-item"
|
|
@@ -151,45 +141,25 @@
|
|
|
151
141
|
role="button"
|
|
152
142
|
aria-expanded="false"
|
|
153
143
|
@keydown.tab="
|
|
154
|
-
searchFocus(
|
|
155
|
-
secondIndex,
|
|
156
|
-
firstLevelLink.below.length,
|
|
157
|
-
$event,
|
|
158
|
-
)
|
|
144
|
+
searchFocus(secondIndex, firstLevelLink.below.length, $event)
|
|
159
145
|
"
|
|
160
146
|
@click.prevent="
|
|
161
147
|
secondLevelClick(
|
|
162
148
|
secondLevelLink,
|
|
163
|
-
`secondLevelMenuItem-${parentIndex}-${secondIndex}
|
|
149
|
+
`secondLevelMenuItem-${parentIndex}-${secondIndex}`
|
|
164
150
|
)
|
|
165
151
|
"
|
|
166
152
|
@mouseover="
|
|
167
|
-
mouseHover(
|
|
168
|
-
'secondLevelMenuItem',
|
|
169
|
-
parentIndex,
|
|
170
|
-
secondIndex,
|
|
171
|
-
)
|
|
153
|
+
mouseHover('secondLevelMenuItem', parentIndex, secondIndex)
|
|
172
154
|
"
|
|
173
155
|
@mouseleave="
|
|
174
|
-
mouseLeave(
|
|
175
|
-
'secondLevelMenuItem',
|
|
176
|
-
parentIndex,
|
|
177
|
-
secondIndex,
|
|
178
|
-
)
|
|
156
|
+
mouseLeave('secondLevelMenuItem', parentIndex, secondIndex)
|
|
179
157
|
"
|
|
180
158
|
@focusin="
|
|
181
|
-
mouseHover(
|
|
182
|
-
'secondLevelMenuItem',
|
|
183
|
-
parentIndex,
|
|
184
|
-
secondIndex,
|
|
185
|
-
)
|
|
159
|
+
mouseHover('secondLevelMenuItem', parentIndex, secondIndex)
|
|
186
160
|
"
|
|
187
161
|
@focusout="
|
|
188
|
-
mouseLeave(
|
|
189
|
-
'secondLevelMenuItem',
|
|
190
|
-
parentIndex,
|
|
191
|
-
secondIndex,
|
|
192
|
-
)
|
|
162
|
+
mouseLeave('secondLevelMenuItem', parentIndex, secondIndex)
|
|
193
163
|
"
|
|
194
164
|
>
|
|
195
165
|
<span>{{ secondLevelLink.title }}</span>
|
|
@@ -210,39 +180,19 @@
|
|
|
210
180
|
class="dark"
|
|
211
181
|
:to="secondLevelLink.relative"
|
|
212
182
|
@keydown.tab.native="
|
|
213
|
-
searchFocus(
|
|
214
|
-
secondIndex,
|
|
215
|
-
firstLevelLink.below.length,
|
|
216
|
-
$event,
|
|
217
|
-
)
|
|
183
|
+
searchFocus(secondIndex, firstLevelLink.below.length, $event)
|
|
218
184
|
"
|
|
219
185
|
@mouseover.native="
|
|
220
|
-
mouseHover(
|
|
221
|
-
'secondLevelMenuItem',
|
|
222
|
-
parentIndex,
|
|
223
|
-
secondIndex,
|
|
224
|
-
)
|
|
186
|
+
mouseHover('secondLevelMenuItem', parentIndex, secondIndex)
|
|
225
187
|
"
|
|
226
188
|
@mouseleave.native="
|
|
227
|
-
mouseLeave(
|
|
228
|
-
'secondLevelMenuItem',
|
|
229
|
-
parentIndex,
|
|
230
|
-
secondIndex,
|
|
231
|
-
)
|
|
189
|
+
mouseLeave('secondLevelMenuItem', parentIndex, secondIndex)
|
|
232
190
|
"
|
|
233
191
|
@focusin.native="
|
|
234
|
-
mouseHover(
|
|
235
|
-
'secondLevelMenuItem',
|
|
236
|
-
parentIndex,
|
|
237
|
-
secondIndex,
|
|
238
|
-
)
|
|
192
|
+
mouseHover('secondLevelMenuItem', parentIndex, secondIndex)
|
|
239
193
|
"
|
|
240
194
|
@focusout.native="
|
|
241
|
-
mouseLeave(
|
|
242
|
-
'secondLevelMenuItem',
|
|
243
|
-
parentIndex,
|
|
244
|
-
secondIndex,
|
|
245
|
-
)
|
|
195
|
+
mouseLeave('secondLevelMenuItem', parentIndex, secondIndex)
|
|
246
196
|
"
|
|
247
197
|
@click.native="fireAnalytics(secondLevelLink)"
|
|
248
198
|
>
|
|
@@ -264,10 +214,7 @@
|
|
|
264
214
|
<span v-else>{{ secondLevelLink.title }}</span>
|
|
265
215
|
</div>
|
|
266
216
|
<div class="selected-sub-nav">
|
|
267
|
-
<ul
|
|
268
|
-
v-if="secondLevelLink.below"
|
|
269
|
-
class="sub-nav-group"
|
|
270
|
-
>
|
|
217
|
+
<ul v-if="secondLevelLink.below" class="sub-nav-group">
|
|
271
218
|
<li
|
|
272
219
|
v-for="(
|
|
273
220
|
thirdLevelLink, thirdIndex
|
|
@@ -283,7 +230,7 @@
|
|
|
283
230
|
searchFocus(
|
|
284
231
|
thirdIndex,
|
|
285
232
|
secondLevelLink.below.length,
|
|
286
|
-
$event
|
|
233
|
+
$event
|
|
287
234
|
)
|
|
288
235
|
"
|
|
289
236
|
@mouseover.native="
|
|
@@ -291,7 +238,7 @@
|
|
|
291
238
|
'thirdLevelMenuItem',
|
|
292
239
|
parentIndex,
|
|
293
240
|
secondIndex,
|
|
294
|
-
thirdIndex
|
|
241
|
+
thirdIndex
|
|
295
242
|
)
|
|
296
243
|
"
|
|
297
244
|
@mouseleave.native="
|
|
@@ -299,7 +246,7 @@
|
|
|
299
246
|
'thirdLevelMenuItem',
|
|
300
247
|
parentIndex,
|
|
301
248
|
secondIndex,
|
|
302
|
-
thirdIndex
|
|
249
|
+
thirdIndex
|
|
303
250
|
)
|
|
304
251
|
"
|
|
305
252
|
@focusin.native="
|
|
@@ -307,7 +254,7 @@
|
|
|
307
254
|
'thirdLevelMenuItem',
|
|
308
255
|
parentIndex,
|
|
309
256
|
secondIndex,
|
|
310
|
-
thirdIndex
|
|
257
|
+
thirdIndex
|
|
311
258
|
)
|
|
312
259
|
"
|
|
313
260
|
@focusout.native="
|
|
@@ -315,20 +262,14 @@
|
|
|
315
262
|
'thirdLevelMenuItem',
|
|
316
263
|
parentIndex,
|
|
317
264
|
secondIndex,
|
|
318
|
-
thirdIndex
|
|
265
|
+
thirdIndex
|
|
319
266
|
)
|
|
320
267
|
"
|
|
321
|
-
@click.native="
|
|
322
|
-
fireAnalytics(thirdLevelLink)
|
|
323
|
-
"
|
|
268
|
+
@click.native="fireAnalytics(thirdLevelLink)"
|
|
324
269
|
>
|
|
325
270
|
<span>{{ thirdLevelLink.title }}</span>
|
|
326
271
|
</nuxt-link>
|
|
327
|
-
<a
|
|
328
|
-
v-else
|
|
329
|
-
class="dark"
|
|
330
|
-
:href="thirdLevelLink.absolute"
|
|
331
|
-
>
|
|
272
|
+
<a v-else class="dark" :href="thirdLevelLink.absolute">
|
|
332
273
|
<span>{{ thirdLevelLink.title }}</span>
|
|
333
274
|
</a>
|
|
334
275
|
</li>
|
|
@@ -402,6 +343,7 @@
|
|
|
402
343
|
</div>
|
|
403
344
|
<div v-if="isSearchOpen && !isWorkWell" class="search-container">
|
|
404
345
|
<modal-search
|
|
346
|
+
:google-search-flag="'googlerest'"
|
|
405
347
|
:search-query="searchQuery"
|
|
406
348
|
:content-parser="contentParser"
|
|
407
349
|
@closed="closeSearch"
|
|
@@ -412,15 +354,15 @@
|
|
|
412
354
|
</template>
|
|
413
355
|
|
|
414
356
|
<script>
|
|
415
|
-
import ModalSearch from
|
|
416
|
-
import Close from
|
|
417
|
-
import WorkSafeLogo from
|
|
418
|
-
import WorkWellLogo from
|
|
419
|
-
import CaretRight from
|
|
420
|
-
import CaretDown from
|
|
421
|
-
import SearchIcon from
|
|
422
|
-
import CaretLeft from
|
|
423
|
-
import MenuIcon from
|
|
357
|
+
import ModalSearch from "./ModalSearch/index.vue";
|
|
358
|
+
import Close from "./../../../assets/icons/close.svg?component";
|
|
359
|
+
import WorkSafeLogo from "./../../../assets/icons/AppFooter/worksafe-footer-logo.svg?url";
|
|
360
|
+
import WorkWellLogo from "./../../../assets/icons/AppFooter/logo-workwell-reversed.svg?url";
|
|
361
|
+
import CaretRight from "./../../../assets/icons/caret-right.svg?component";
|
|
362
|
+
import CaretDown from "./../../../assets/icons/caret-down.svg?component";
|
|
363
|
+
import SearchIcon from "./../../../assets/icons/AppHeader/search-32px.svg?component";
|
|
364
|
+
import CaretLeft from "./../../../assets/icons/caret-left.svg?component";
|
|
365
|
+
import MenuIcon from "./../../../assets/icons/AppHeader/menu-32px.svg?component";
|
|
424
366
|
|
|
425
367
|
export default {
|
|
426
368
|
components: {
|
|
@@ -470,85 +412,81 @@ export default {
|
|
|
470
412
|
MenuIcon,
|
|
471
413
|
windowWidth: 0,
|
|
472
414
|
searchQuery: null,
|
|
473
|
-
}
|
|
415
|
+
};
|
|
474
416
|
},
|
|
475
417
|
computed: {
|
|
476
418
|
showSecondLevelCaret() {
|
|
477
419
|
return (
|
|
478
|
-
(this.screen ===
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
this.screen === 'desktop'
|
|
482
|
-
)
|
|
420
|
+
(this.screen === "mobile" && this.isSecondLevelOpen && !this.isThirdLevelOpen) ||
|
|
421
|
+
this.screen === "desktop"
|
|
422
|
+
);
|
|
483
423
|
},
|
|
484
424
|
isChrome() {
|
|
485
|
-
return !!window.chrome
|
|
425
|
+
return !!window.chrome;
|
|
486
426
|
},
|
|
487
427
|
},
|
|
488
428
|
watch: {
|
|
489
429
|
$route() {
|
|
490
430
|
if (this.screen) {
|
|
491
|
-
this.closeMegaMenu()
|
|
431
|
+
this.closeMegaMenu();
|
|
492
432
|
}
|
|
493
433
|
},
|
|
494
434
|
windowWidth(val) {
|
|
495
435
|
if (val > 980) {
|
|
496
|
-
this.screen =
|
|
436
|
+
this.screen = "desktop";
|
|
497
437
|
} else if (val <= 980) {
|
|
498
|
-
this.screen =
|
|
438
|
+
this.screen = "mobile";
|
|
499
439
|
if (this.isSecondLevelOpen === true) {
|
|
500
|
-
this.isMobileMenuOpen = true
|
|
440
|
+
this.isMobileMenuOpen = true;
|
|
501
441
|
}
|
|
502
442
|
}
|
|
503
443
|
},
|
|
504
444
|
},
|
|
505
445
|
destroyed() {
|
|
506
|
-
window.removeEventListener(
|
|
446
|
+
window.removeEventListener("resize", this.screenWidth);
|
|
507
447
|
},
|
|
508
448
|
created() {
|
|
509
|
-
if (typeof window !==
|
|
510
|
-
window.addEventListener(
|
|
511
|
-
this.screenWidth()
|
|
449
|
+
if (typeof window !== "undefined" && window) {
|
|
450
|
+
window.addEventListener("resize", this.screenWidth);
|
|
451
|
+
this.screenWidth();
|
|
512
452
|
}
|
|
513
453
|
if (this.$bus) {
|
|
514
|
-
this.$bus.$on(
|
|
515
|
-
this.searchQuery = query
|
|
454
|
+
this.$bus.$on("site-search", (query) => {
|
|
455
|
+
this.searchQuery = query;
|
|
516
456
|
if (query) {
|
|
517
|
-
this.showSearch()
|
|
457
|
+
this.showSearch();
|
|
518
458
|
}
|
|
519
|
-
})
|
|
459
|
+
});
|
|
520
460
|
}
|
|
521
461
|
},
|
|
522
462
|
methods: {
|
|
523
463
|
screenWidth() {
|
|
524
|
-
this.windowWidth = window.innerWidth
|
|
464
|
+
this.windowWidth = window.innerWidth;
|
|
525
465
|
},
|
|
526
466
|
firstLevelClick(item, ref) {
|
|
527
|
-
console.log(
|
|
467
|
+
console.log("in first level click");
|
|
528
468
|
// Reset screen to fix whitespace
|
|
529
|
-
if (window && window.scrollTo && this.screen ===
|
|
530
|
-
window.scrollTo(0, 0)
|
|
469
|
+
if (window && window.scrollTo && this.screen === "desktop") {
|
|
470
|
+
window.scrollTo(0, 0);
|
|
531
471
|
}
|
|
532
472
|
|
|
533
|
-
let selectedItem = this.$refs[ref][0]
|
|
534
|
-
let previouslyOpenItem = this.getActiveParent()
|
|
473
|
+
let selectedItem = this.$refs[ref][0];
|
|
474
|
+
let previouslyOpenItem = this.getActiveParent();
|
|
535
475
|
|
|
536
476
|
// Set this for mobile
|
|
537
|
-
this.firstLevelItemName = item.title
|
|
538
|
-
this.firstLevelItemRef = ref
|
|
477
|
+
this.firstLevelItemName = item.title;
|
|
478
|
+
this.firstLevelItemRef = ref;
|
|
539
479
|
|
|
540
480
|
// Set the first item to the variable
|
|
541
481
|
if (previouslyOpenItem.length) {
|
|
542
|
-
previouslyOpenItem = previouslyOpenItem[0]
|
|
482
|
+
previouslyOpenItem = previouslyOpenItem[0];
|
|
543
483
|
}
|
|
544
484
|
// If the menu is not open, open it
|
|
545
485
|
if (item.below && this.isSecondLevelOpen === false) {
|
|
546
|
-
selectedItem.classList.add(
|
|
547
|
-
selectedItem
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
this.isSecondLevelOpen = true
|
|
551
|
-
this.letBodyOverflow(false)
|
|
486
|
+
selectedItem.classList.add("isActiveParent");
|
|
487
|
+
selectedItem.getElementsByTagName("a")[0].setAttribute("aria-expanded", "true");
|
|
488
|
+
this.isSecondLevelOpen = true;
|
|
489
|
+
this.letBodyOverflow(false);
|
|
552
490
|
}
|
|
553
491
|
// If the menu is already open and the same item is clicked,
|
|
554
492
|
// close it
|
|
@@ -557,57 +495,51 @@ export default {
|
|
|
557
495
|
this.isSecondLevelOpen === true &&
|
|
558
496
|
selectedItem === previouslyOpenItem
|
|
559
497
|
) {
|
|
560
|
-
selectedItem.classList.remove(
|
|
561
|
-
selectedItem
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
this.isSecondLevelOpen = false
|
|
565
|
-
this.letBodyOverflow(true)
|
|
498
|
+
selectedItem.classList.remove("isActiveParent");
|
|
499
|
+
selectedItem.getElementsByTagName("a")[0].setAttribute("aria-expanded", "false");
|
|
500
|
+
this.isSecondLevelOpen = false;
|
|
501
|
+
this.letBodyOverflow(true);
|
|
566
502
|
}
|
|
567
503
|
// If the link has no children then go to that page
|
|
568
504
|
else if (!item.below) {
|
|
569
|
-
if (item.relative !==
|
|
570
|
-
this.$router.push(item.relative)
|
|
505
|
+
if (item.relative !== "/") {
|
|
506
|
+
this.$router.push(item.relative);
|
|
571
507
|
}
|
|
572
508
|
}
|
|
573
509
|
// Otherwise just remove the existing open menu and add
|
|
574
510
|
// the isActive class on the new selected item
|
|
575
511
|
else {
|
|
576
|
-
previouslyOpenItem.classList.remove(
|
|
577
|
-
selectedItem.classList.add(
|
|
512
|
+
previouslyOpenItem.classList.remove("isActiveParent");
|
|
513
|
+
selectedItem.classList.add("isActiveParent");
|
|
578
514
|
previouslyOpenItem
|
|
579
|
-
.getElementsByTagName(
|
|
580
|
-
.setAttribute(
|
|
581
|
-
selectedItem
|
|
582
|
-
.getElementsByTagName('a')[0]
|
|
583
|
-
.setAttribute('aria-expanded', 'true')
|
|
515
|
+
.getElementsByTagName("a")[0]
|
|
516
|
+
.setAttribute("aria-expanded", "false");
|
|
517
|
+
selectedItem.getElementsByTagName("a")[0].setAttribute("aria-expanded", "true");
|
|
584
518
|
}
|
|
585
|
-
if (this.screen ===
|
|
586
|
-
this.focusOnNext(selectedItem)
|
|
519
|
+
if (this.screen === "mobile") {
|
|
520
|
+
this.focusOnNext(selectedItem);
|
|
587
521
|
}
|
|
588
522
|
},
|
|
589
523
|
secondLevelClick(item, ref) {
|
|
590
|
-
let selectedItem = this.$refs[ref][0]
|
|
591
|
-
let previouslyOpenItem = this.getActiveChild()
|
|
592
|
-
this.secondLevelItemRef = ref
|
|
524
|
+
let selectedItem = this.$refs[ref][0];
|
|
525
|
+
let previouslyOpenItem = this.getActiveChild();
|
|
526
|
+
this.secondLevelItemRef = ref;
|
|
593
527
|
|
|
594
528
|
// Set the first item to the variable
|
|
595
529
|
if (previouslyOpenItem.length) {
|
|
596
|
-
previouslyOpenItem = previouslyOpenItem[0]
|
|
530
|
+
previouslyOpenItem = previouslyOpenItem[0];
|
|
597
531
|
}
|
|
598
532
|
|
|
599
533
|
// If the menu is not open, open it
|
|
600
534
|
if (item.below && this.isThirdLevelOpen === false) {
|
|
601
|
-
selectedItem.classList.add(
|
|
602
|
-
selectedItem
|
|
603
|
-
|
|
604
|
-
.setAttribute('aria-expanded', 'true')
|
|
605
|
-
this.isThirdLevelOpen = true
|
|
535
|
+
selectedItem.classList.add("isActiveChild");
|
|
536
|
+
selectedItem.getElementsByTagName("a")[0].setAttribute("aria-expanded", "true");
|
|
537
|
+
this.isThirdLevelOpen = true;
|
|
606
538
|
}
|
|
607
539
|
// If the link has no children then go to that page
|
|
608
540
|
else if (!item.below) {
|
|
609
|
-
if (item.relative !==
|
|
610
|
-
this.$router.push(item.relative)
|
|
541
|
+
if (item.relative !== "/") {
|
|
542
|
+
this.$router.push(item.relative);
|
|
611
543
|
}
|
|
612
544
|
}
|
|
613
545
|
// If the menu is already open and the same item is clicked,
|
|
@@ -617,260 +549,238 @@ export default {
|
|
|
617
549
|
this.isThirdLevelOpen === true &&
|
|
618
550
|
selectedItem === previouslyOpenItem
|
|
619
551
|
) {
|
|
620
|
-
selectedItem.classList.remove(
|
|
621
|
-
selectedItem
|
|
622
|
-
|
|
623
|
-
.setAttribute('aria-expanded', 'false')
|
|
624
|
-
this.isThirdLevelOpen = false
|
|
552
|
+
selectedItem.classList.remove("isActiveChild");
|
|
553
|
+
selectedItem.getElementsByTagName("a")[0].setAttribute("aria-expanded", "false");
|
|
554
|
+
this.isThirdLevelOpen = false;
|
|
625
555
|
}
|
|
626
556
|
// Otherwise just remove the existing open menu and add
|
|
627
557
|
// the isActive class on the new selected item
|
|
628
558
|
else {
|
|
629
|
-
previouslyOpenItem.classList.remove(
|
|
559
|
+
previouslyOpenItem.classList.remove("isActiveChild");
|
|
630
560
|
previouslyOpenItem
|
|
631
|
-
.getElementsByTagName(
|
|
632
|
-
.setAttribute(
|
|
633
|
-
selectedItem.classList.add(
|
|
634
|
-
selectedItem
|
|
635
|
-
.getElementsByTagName('a')[0]
|
|
636
|
-
.setAttribute('aria-expanded', 'true')
|
|
561
|
+
.getElementsByTagName("a")[0]
|
|
562
|
+
.setAttribute("aria-expanded", "false");
|
|
563
|
+
selectedItem.classList.add("isActiveChild");
|
|
564
|
+
selectedItem.getElementsByTagName("a")[0].setAttribute("aria-expanded", "true");
|
|
637
565
|
}
|
|
638
566
|
|
|
639
|
-
this.focusOnNext(selectedItem)
|
|
567
|
+
this.focusOnNext(selectedItem);
|
|
640
568
|
},
|
|
641
569
|
showMobileMenu() {
|
|
642
570
|
// Reset screen to top to fix whitespace issues
|
|
643
571
|
if (window) {
|
|
644
|
-
window.scrollTo(0, 0)
|
|
572
|
+
window.scrollTo(0, 0);
|
|
645
573
|
}
|
|
646
574
|
|
|
647
|
-
this.isMobileMenuOpen = true
|
|
648
|
-
this.letBodyOverflow(false)
|
|
575
|
+
this.isMobileMenuOpen = true;
|
|
576
|
+
this.letBodyOverflow(false);
|
|
649
577
|
this.$nextTick(() => {
|
|
650
|
-
this.$refs[
|
|
651
|
-
})
|
|
578
|
+
this.$refs["firstLevelMenuItem-0"][0].firstElementChild.focus();
|
|
579
|
+
});
|
|
652
580
|
},
|
|
653
581
|
mouseHover(refID, parentIndex, secondIndex, thirdIndex) {
|
|
654
|
-
let theLI = this.getLIaboveHovered(
|
|
655
|
-
refID,
|
|
656
|
-
parentIndex,
|
|
657
|
-
secondIndex,
|
|
658
|
-
thirdIndex,
|
|
659
|
-
)
|
|
582
|
+
let theLI = this.getLIaboveHovered(refID, parentIndex, secondIndex, thirdIndex);
|
|
660
583
|
if (theLI) {
|
|
661
|
-
let A = theLI.getElementsByTagName(
|
|
662
|
-
A.style.borderBottom =
|
|
584
|
+
let A = theLI.getElementsByTagName("A")[0];
|
|
585
|
+
A.style.borderBottom = "1px solid transparent";
|
|
663
586
|
}
|
|
664
587
|
},
|
|
665
588
|
mouseLeave(refID, parentIndex, secondIndex, thirdIndex) {
|
|
666
|
-
let theLI = this.getLIaboveHovered(
|
|
667
|
-
refID,
|
|
668
|
-
parentIndex,
|
|
669
|
-
secondIndex,
|
|
670
|
-
thirdIndex,
|
|
671
|
-
)
|
|
589
|
+
let theLI = this.getLIaboveHovered(refID, parentIndex, secondIndex, thirdIndex);
|
|
672
590
|
if (theLI) {
|
|
673
|
-
let A = theLI.getElementsByTagName(
|
|
674
|
-
A.removeAttribute(
|
|
591
|
+
let A = theLI.getElementsByTagName("A")[0];
|
|
592
|
+
A.removeAttribute("style");
|
|
675
593
|
}
|
|
676
594
|
},
|
|
677
595
|
getLIaboveHovered(refID, parentIndex, secondIndex, thirdIndex) {
|
|
678
596
|
// Check if its a first level link
|
|
679
597
|
if (secondIndex === undefined && thirdIndex === undefined) {
|
|
680
|
-
if (screen ===
|
|
681
|
-
return
|
|
598
|
+
if (screen === "desktop") {
|
|
599
|
+
return;
|
|
682
600
|
}
|
|
683
601
|
|
|
684
|
-
let prevFirstIndex = parentIndex - 1
|
|
602
|
+
let prevFirstIndex = parentIndex - 1;
|
|
685
603
|
|
|
686
604
|
if (prevFirstIndex < 0) {
|
|
687
|
-
return
|
|
605
|
+
return;
|
|
688
606
|
} else {
|
|
689
|
-
let aboveHovered = `${refID}-${prevFirstIndex}
|
|
690
|
-
return this.$refs[aboveHovered][0]
|
|
607
|
+
let aboveHovered = `${refID}-${prevFirstIndex}`;
|
|
608
|
+
return this.$refs[aboveHovered][0];
|
|
691
609
|
}
|
|
692
610
|
}
|
|
693
611
|
// Check if its a second level link
|
|
694
612
|
else if (thirdIndex === undefined) {
|
|
695
|
-
let prevSecondIndex = secondIndex - 1
|
|
613
|
+
let prevSecondIndex = secondIndex - 1;
|
|
696
614
|
if (prevSecondIndex < 0) {
|
|
697
|
-
return
|
|
615
|
+
return;
|
|
698
616
|
} else {
|
|
699
|
-
let aboveHovered = `${refID}-${parentIndex}-${prevSecondIndex}
|
|
700
|
-
return this.$refs[aboveHovered][0]
|
|
617
|
+
let aboveHovered = `${refID}-${parentIndex}-${prevSecondIndex}`;
|
|
618
|
+
return this.$refs[aboveHovered][0];
|
|
701
619
|
}
|
|
702
620
|
}
|
|
703
621
|
// If its a third level link
|
|
704
622
|
else {
|
|
705
|
-
let prevThirdIndex = thirdIndex - 1
|
|
623
|
+
let prevThirdIndex = thirdIndex - 1;
|
|
706
624
|
if (prevThirdIndex < 0) {
|
|
707
|
-
return
|
|
625
|
+
return;
|
|
708
626
|
} else {
|
|
709
|
-
let aboveHovered = `${refID}-${parentIndex}-${secondIndex}-${prevThirdIndex}
|
|
710
|
-
return this.$refs[aboveHovered][0]
|
|
627
|
+
let aboveHovered = `${refID}-${parentIndex}-${secondIndex}-${prevThirdIndex}`;
|
|
628
|
+
return this.$refs[aboveHovered][0];
|
|
711
629
|
}
|
|
712
630
|
}
|
|
713
631
|
},
|
|
714
632
|
showSearch() {
|
|
715
|
-
this.isSearchOpen = true
|
|
716
|
-
this.letBodyOverflow(false)
|
|
633
|
+
this.isSearchOpen = true;
|
|
634
|
+
this.letBodyOverflow(false);
|
|
717
635
|
},
|
|
718
636
|
closeSearch() {
|
|
719
|
-
this.isSearchOpen = false
|
|
720
|
-
this.letBodyOverflow(true)
|
|
721
|
-
this.resetTab()
|
|
722
|
-
this.searchQuery = null
|
|
637
|
+
this.isSearchOpen = false;
|
|
638
|
+
this.letBodyOverflow(true);
|
|
639
|
+
this.resetTab();
|
|
640
|
+
this.searchQuery = null;
|
|
723
641
|
},
|
|
724
642
|
closeMegaMenu() {
|
|
725
|
-
let activeChild = this.getActiveChild()
|
|
726
|
-
let theActiveParent = this.getActiveParent()
|
|
643
|
+
let activeChild = this.getActiveChild();
|
|
644
|
+
let theActiveParent = this.getActiveParent();
|
|
727
645
|
|
|
728
646
|
if (theActiveParent.length) {
|
|
729
|
-
theActiveParent = theActiveParent[0]
|
|
730
|
-
theActiveParent.classList.remove(
|
|
647
|
+
theActiveParent = theActiveParent[0];
|
|
648
|
+
theActiveParent.classList.remove("isActiveParent");
|
|
731
649
|
theActiveParent
|
|
732
|
-
.getElementsByTagName(
|
|
733
|
-
.setAttribute(
|
|
650
|
+
.getElementsByTagName("a")[0]
|
|
651
|
+
.setAttribute("aria-expanded", "false");
|
|
734
652
|
}
|
|
735
653
|
|
|
736
654
|
if (this.isThirdLevelOpen) {
|
|
737
|
-
activeChild = activeChild[0]
|
|
738
|
-
activeChild.classList.remove(
|
|
739
|
-
activeChild
|
|
740
|
-
|
|
741
|
-
.setAttribute('aria-expanded', 'false')
|
|
742
|
-
this.isThirdLevelOpen = false
|
|
655
|
+
activeChild = activeChild[0];
|
|
656
|
+
activeChild.classList.remove("isActiveChild");
|
|
657
|
+
activeChild.getElementsByTagName("a")[0].setAttribute("aria-expanded", "false");
|
|
658
|
+
this.isThirdLevelOpen = false;
|
|
743
659
|
}
|
|
744
|
-
this.isMobileMenuOpen = false
|
|
745
|
-
this.isSecondLevelOpen = false
|
|
746
|
-
this.letBodyOverflow(true)
|
|
660
|
+
this.isMobileMenuOpen = false;
|
|
661
|
+
this.isSecondLevelOpen = false;
|
|
662
|
+
this.letBodyOverflow(true);
|
|
747
663
|
},
|
|
748
664
|
letBodyOverflow(state) {
|
|
749
|
-
let body = document.body
|
|
750
|
-
let main = document.getElementsByTagName(
|
|
751
|
-
let footer = document.getElementsByTagName(
|
|
665
|
+
let body = document.body;
|
|
666
|
+
let main = document.getElementsByTagName("main")[0];
|
|
667
|
+
let footer = document.getElementsByTagName("footer")[0];
|
|
752
668
|
switch (state) {
|
|
753
669
|
case true:
|
|
754
|
-
body.removeAttribute(
|
|
670
|
+
body.removeAttribute("style");
|
|
755
671
|
if (main) {
|
|
756
|
-
main.removeAttribute(
|
|
672
|
+
main.removeAttribute("style");
|
|
757
673
|
}
|
|
758
674
|
if (footer) {
|
|
759
|
-
footer.removeAttribute(
|
|
675
|
+
footer.removeAttribute("style");
|
|
760
676
|
}
|
|
761
|
-
break
|
|
677
|
+
break;
|
|
762
678
|
case false:
|
|
763
|
-
body.style.overflow =
|
|
764
|
-
body.style.background =
|
|
679
|
+
body.style.overflow = "hidden";
|
|
680
|
+
body.style.background = "#ffffff";
|
|
765
681
|
if (main) {
|
|
766
|
-
main.style.display =
|
|
682
|
+
main.style.display = "none";
|
|
767
683
|
}
|
|
768
684
|
if (footer) {
|
|
769
|
-
footer.style.display =
|
|
685
|
+
footer.style.display = "none";
|
|
770
686
|
}
|
|
771
|
-
break
|
|
687
|
+
break;
|
|
772
688
|
}
|
|
773
689
|
},
|
|
774
690
|
resetTab(el) {
|
|
775
691
|
if (this.$refs.closeMenuButton) {
|
|
776
692
|
if (el) {
|
|
777
|
-
el.preventDefault()
|
|
693
|
+
el.preventDefault();
|
|
778
694
|
}
|
|
779
|
-
this.$refs.closeMenuButton.focus()
|
|
695
|
+
this.$refs.closeMenuButton.focus();
|
|
780
696
|
}
|
|
781
697
|
},
|
|
782
698
|
getActiveParent() {
|
|
783
|
-
return document.getElementsByClassName(
|
|
699
|
+
return document.getElementsByClassName("isActiveParent");
|
|
784
700
|
},
|
|
785
701
|
getActiveChild() {
|
|
786
|
-
return document.getElementsByClassName(
|
|
702
|
+
return document.getElementsByClassName("isActiveChild");
|
|
787
703
|
},
|
|
788
704
|
mobileGoBack() {
|
|
789
705
|
if (this.isThirdLevelOpen) {
|
|
790
|
-
let activeChild = this.getActiveChild()
|
|
791
|
-
activeChild = activeChild[0]
|
|
792
|
-
activeChild.classList.remove(
|
|
793
|
-
activeChild
|
|
794
|
-
|
|
795
|
-
.setAttribute('aria-expanded', 'false')
|
|
796
|
-
this.isThirdLevelOpen = false
|
|
706
|
+
let activeChild = this.getActiveChild();
|
|
707
|
+
activeChild = activeChild[0];
|
|
708
|
+
activeChild.classList.remove("isActiveChild");
|
|
709
|
+
activeChild.getElementsByTagName("a")[0].setAttribute("aria-expanded", "false");
|
|
710
|
+
this.isThirdLevelOpen = false;
|
|
797
711
|
} else if (this.isSecondLevelOpen) {
|
|
798
|
-
let activeParent = this.getActiveParent()
|
|
799
|
-
activeParent = activeParent[0]
|
|
800
|
-
activeParent.classList.remove(
|
|
801
|
-
activeParent
|
|
802
|
-
|
|
803
|
-
.setAttribute('aria-expanded', 'false')
|
|
804
|
-
this.isSecondLevelOpen = false
|
|
712
|
+
let activeParent = this.getActiveParent();
|
|
713
|
+
activeParent = activeParent[0];
|
|
714
|
+
activeParent.classList.remove("isActiveParent");
|
|
715
|
+
activeParent.getElementsByTagName("a")[0].setAttribute("aria-expanded", "false");
|
|
716
|
+
this.isSecondLevelOpen = false;
|
|
805
717
|
}
|
|
806
718
|
},
|
|
807
719
|
searchFocus(index, length, event) {
|
|
808
720
|
if (index === length - 1 && this.isMobileMenuOpen && !event.shiftKey) {
|
|
809
|
-
event.preventDefault()
|
|
810
|
-
this.$refs.searchButton.focus()
|
|
721
|
+
event.preventDefault();
|
|
722
|
+
this.$refs.searchButton.focus();
|
|
811
723
|
} else if (index === 0 && this.isMobileMenuOpen && event.shiftKey) {
|
|
812
|
-
event.preventDefault()
|
|
813
|
-
let firstIndex = this.firstLevelItemRef.split(
|
|
814
|
-
let key = null
|
|
724
|
+
event.preventDefault();
|
|
725
|
+
let firstIndex = this.firstLevelItemRef.split("-")[1];
|
|
726
|
+
let key = null;
|
|
815
727
|
if (!this.isThirdLevelOpen) {
|
|
816
|
-
key = `secondLevelSelectedTitle-${firstIndex}
|
|
728
|
+
key = `secondLevelSelectedTitle-${firstIndex}`;
|
|
817
729
|
} else if (this.isThirdLevelOpen) {
|
|
818
|
-
let secondIndex = this.secondLevelItemRef.split(
|
|
819
|
-
key = `secondLevelSelectedTitle-${firstIndex}-${secondIndex}
|
|
730
|
+
let secondIndex = this.secondLevelItemRef.split("-")[2];
|
|
731
|
+
key = `secondLevelSelectedTitle-${firstIndex}-${secondIndex}`;
|
|
820
732
|
}
|
|
821
|
-
if (this.$refs[key][0].$el.nodeName ===
|
|
822
|
-
this.$refs[key][0].$el.focus()
|
|
733
|
+
if (this.$refs[key][0].$el.nodeName === "A") {
|
|
734
|
+
this.$refs[key][0].$el.focus();
|
|
823
735
|
}
|
|
824
736
|
}
|
|
825
737
|
},
|
|
826
738
|
submenuFocus(event) {
|
|
827
739
|
if (this.isMobileMenuOpen && !event.shiftKey && this.isSecondLevelOpen) {
|
|
828
|
-
event.preventDefault()
|
|
829
|
-
let firstIndex = this.firstLevelItemRef.split(
|
|
830
|
-
let key = null
|
|
740
|
+
event.preventDefault();
|
|
741
|
+
let firstIndex = this.firstLevelItemRef.split("-")[1];
|
|
742
|
+
let key = null;
|
|
831
743
|
if (!this.isThirdLevelOpen) {
|
|
832
|
-
key = `secondLevelSelectedTitle-${firstIndex}
|
|
744
|
+
key = `secondLevelSelectedTitle-${firstIndex}`;
|
|
833
745
|
} else if (this.isThirdLevelOpen) {
|
|
834
|
-
let secondIndex = this.secondLevelItemRef.split(
|
|
835
|
-
key = `secondLevelSelectedTitle-${firstIndex}-${secondIndex}
|
|
746
|
+
let secondIndex = this.secondLevelItemRef.split("-")[2];
|
|
747
|
+
key = `secondLevelSelectedTitle-${firstIndex}-${secondIndex}`;
|
|
836
748
|
}
|
|
837
|
-
if (this.$refs[key][0].$el.nodeName ===
|
|
838
|
-
this.$refs[key][0].$el.focus()
|
|
749
|
+
if (this.$refs[key][0].$el.nodeName === "A") {
|
|
750
|
+
this.$refs[key][0].$el.focus();
|
|
839
751
|
}
|
|
840
752
|
}
|
|
841
753
|
},
|
|
842
754
|
backBtnFocus(event) {
|
|
843
755
|
if (this.isMobileMenuOpen && event.shiftKey && this.isSecondLevelOpen) {
|
|
844
|
-
event.preventDefault()
|
|
845
|
-
this.$refs.menuBackButton.focus()
|
|
756
|
+
event.preventDefault();
|
|
757
|
+
this.$refs.menuBackButton.focus();
|
|
846
758
|
}
|
|
847
759
|
},
|
|
848
760
|
focusOnNext(selectedItem) {
|
|
849
761
|
this.$nextTick(() => {
|
|
850
|
-
selectedItem
|
|
851
|
-
|
|
852
|
-
.firstChild.focus()
|
|
853
|
-
})
|
|
762
|
+
selectedItem.getElementsByClassName("selected-title")[0].firstChild.focus();
|
|
763
|
+
});
|
|
854
764
|
},
|
|
855
765
|
fireAnalytics(content) {
|
|
856
766
|
let payload = {
|
|
857
|
-
event:
|
|
858
|
-
group:
|
|
767
|
+
event: "custom.interaction.megamenu.click",
|
|
768
|
+
group: "Mega Menu",
|
|
859
769
|
label: content.title,
|
|
860
770
|
url: content.relative,
|
|
861
|
-
}
|
|
771
|
+
};
|
|
862
772
|
// this.$store.dispatch('tracking/event', payload)
|
|
863
773
|
},
|
|
864
774
|
skipToContent() {
|
|
865
775
|
if (this.$bus) {
|
|
866
|
-
this.$bus.$emit(
|
|
776
|
+
this.$bus.$emit("scrollToTop");
|
|
867
777
|
}
|
|
868
778
|
},
|
|
869
779
|
},
|
|
870
|
-
}
|
|
780
|
+
};
|
|
871
781
|
</script>
|
|
872
782
|
|
|
873
783
|
<style lang="scss" scoped>
|
|
874
|
-
@import
|
|
875
|
-
@import
|
|
784
|
+
@import "./styles";
|
|
785
|
+
@import "./mobile";
|
|
876
786
|
</style>
|
|
@@ -57,70 +57,73 @@
|
|
|
57
57
|
<div style="padding-top: 20px;">
|
|
58
58
|
<hr>
|
|
59
59
|
</div>
|
|
60
|
-
|
|
60
|
+
<!-- Contacts, if any -->
|
|
61
|
+
<div v-if="validContacts">
|
|
62
|
+
<row >
|
|
61
63
|
<column >
|
|
62
64
|
<h4>Contact Information</h4>
|
|
63
65
|
</column>
|
|
64
66
|
</row>
|
|
65
|
-
<row>
|
|
66
|
-
<column sm="2" class="label">
|
|
67
|
+
<row v-if="item.contact1 !== '' || item.contact2 !== ''">
|
|
68
|
+
<column sm="2" class="label" v-if="item.contact1 !== ''">
|
|
67
69
|
Contact
|
|
68
70
|
</column>
|
|
69
|
-
<column sm="4" class="hscp-additional-records">
|
|
71
|
+
<column sm="4" class="hscp-additional-records" v-if="item.contact1 !== ''">
|
|
70
72
|
{{item.contact1}}
|
|
71
73
|
</column>
|
|
72
|
-
<column sm="2" class="label">
|
|
74
|
+
<column sm="2" class="label" v-if="item.contact2 !== ''">
|
|
73
75
|
Contact
|
|
74
76
|
</column>
|
|
75
|
-
<column sm="4" class="hscp-additional-records">
|
|
77
|
+
<column sm="4" class="hscp-additional-records" v-if="item.contact2 !== ''">
|
|
76
78
|
{{item.contact2}}
|
|
77
79
|
</column>
|
|
78
80
|
</row>
|
|
79
|
-
<row>
|
|
80
|
-
<column sm="2" class="label">
|
|
81
|
+
<row v-if="item.phone1 !== '' || item.phone2 !== ''">
|
|
82
|
+
<column sm="2" class="label" v-if="item.phone1 !== ''">
|
|
81
83
|
Phone
|
|
82
84
|
</column>
|
|
83
|
-
<column sm="4" class="hscp-additional-records">
|
|
85
|
+
<column sm="4" class="hscp-additional-records" v-if="item.phone1 !== ''">
|
|
84
86
|
{{item.phone1}}
|
|
85
87
|
</column>
|
|
86
|
-
<column sm="2" class="label">
|
|
88
|
+
<column sm="2" class="label" v-if="item.phone2 !== ''">
|
|
87
89
|
Phone
|
|
88
90
|
</column>
|
|
89
|
-
<column sm="4" class="hscp-additional-records">
|
|
91
|
+
<column sm="4" class="hscp-additional-records" v-if="item.phone2 !== ''">
|
|
90
92
|
{{item.phone2}}
|
|
91
93
|
</column>
|
|
92
94
|
</row>
|
|
93
|
-
<row>
|
|
94
|
-
<column sm="2" class="label">
|
|
95
|
+
<row v-if="item.email1 !== '' || item.email2 !== ''">
|
|
96
|
+
<column sm="2" class="label" v-if="item.email1 !== ''">
|
|
95
97
|
Email
|
|
96
98
|
</column>
|
|
97
|
-
<column sm="4" class="hscp-additional-records">
|
|
99
|
+
<column sm="4" class="hscp-additional-records" v-if="item.email1 !== ''">
|
|
98
100
|
{{item.email1}}
|
|
99
101
|
</column>
|
|
100
|
-
<column sm="2" class="label">
|
|
102
|
+
<column sm="2" class="label" v-if="item.email2 !== ''">
|
|
101
103
|
Email
|
|
102
104
|
</column>
|
|
103
|
-
<column sm="4" class="hscp-additional-records">
|
|
105
|
+
<column sm="4" class="hscp-additional-records" v-if="item.email1 !== ''">
|
|
104
106
|
{{item.email2}}
|
|
105
107
|
</column>
|
|
106
108
|
</row>
|
|
109
|
+
</div>
|
|
110
|
+
<div v-if="item.trainingVenues.length">
|
|
107
111
|
<row class="row-hscp-additional">
|
|
108
112
|
<column>
|
|
109
113
|
<h4>Training Venue Locations</h4>
|
|
110
114
|
</column>
|
|
111
115
|
</row>
|
|
112
116
|
<row class="hscp-additional-records">
|
|
113
|
-
<column
|
|
117
|
+
<column >
|
|
114
118
|
<ul>
|
|
115
119
|
<li v-for="(venue) in item.trainingVenues.split(',')" :key="venue.id">
|
|
116
120
|
{{venue}}
|
|
117
121
|
</li>
|
|
118
122
|
</ul>
|
|
119
123
|
</column>
|
|
120
|
-
<column v-else-if="!item.trainingVenues.length">
|
|
121
|
-
<p>No training venues</p>
|
|
122
|
-
</column>
|
|
123
124
|
</row>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
124
127
|
<row class="row-hscp-additional">
|
|
125
128
|
<column>
|
|
126
129
|
<h4>Training Courses</h4>
|
|
@@ -170,6 +173,13 @@ export default {
|
|
|
170
173
|
gMapLink() {
|
|
171
174
|
return `https://google.com/maps?q=${this.item.title}%20${this.item.fullAddress}`
|
|
172
175
|
},
|
|
176
|
+
validContacts() {
|
|
177
|
+
if (this.item.contact1 === '' && this.item.contact2 === '' && this.item.phone1 === '' && this.item.phone2 === '' && this.item.email1 === '' && this.item.email2 === '') {
|
|
178
|
+
return false
|
|
179
|
+
} else {
|
|
180
|
+
return true
|
|
181
|
+
}
|
|
182
|
+
}
|
|
173
183
|
|
|
174
184
|
},
|
|
175
185
|
methods: {
|
|
@@ -206,12 +216,11 @@ export default {
|
|
|
206
216
|
align-content: end;
|
|
207
217
|
max-width: 20px;
|
|
208
218
|
padding-right: 0px;
|
|
209
|
-
padding-bottom: 10px;
|
|
210
219
|
float:right;
|
|
211
220
|
}
|
|
212
221
|
.paragraph--directory__records--hscp {
|
|
213
222
|
|
|
214
|
-
padding-bottom:
|
|
223
|
+
padding-bottom: 30px !important;
|
|
215
224
|
|
|
216
225
|
a {
|
|
217
226
|
color: $black;
|
|
@@ -18,14 +18,15 @@
|
|
|
18
18
|
:force-lg-columns-per-row="1"
|
|
19
19
|
:force-md-columns-per-row="1"
|
|
20
20
|
:cards="results"
|
|
21
|
-
:is-selectable="
|
|
21
|
+
:is-selectable="isSelectable"
|
|
22
22
|
:size="'full'"
|
|
23
23
|
:row-spacing="'none'"
|
|
24
24
|
:no-padding-top="true"
|
|
25
|
-
|
|
25
|
+
:google-search-flag="googleSearchFlag"
|
|
26
|
+
@selected="handleSelect"
|
|
27
|
+
@selected-title="handleSelect"
|
|
26
28
|
>
|
|
27
29
|
<template v-slot:cardItem="{ card }">
|
|
28
|
-
<span class="d-none">card.link :- {{ card.link }}</span>
|
|
29
30
|
<card-grid-item
|
|
30
31
|
:header-size="isTypeahead ? 'medium' : 'large'"
|
|
31
32
|
:card-header-title="card.title"
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
topic: card.topic,
|
|
46
47
|
language: card.language,
|
|
47
48
|
}"
|
|
49
|
+
:is-card-title-selectable="isCardTitleSelectable"
|
|
48
50
|
/>
|
|
49
51
|
</template>
|
|
50
52
|
<template
|
|
@@ -133,6 +135,10 @@ export default {
|
|
|
133
135
|
type: Boolean,
|
|
134
136
|
default: true,
|
|
135
137
|
},
|
|
138
|
+
googleSearchFlag: {
|
|
139
|
+
type: String,
|
|
140
|
+
default: "solar",
|
|
141
|
+
},
|
|
136
142
|
},
|
|
137
143
|
methods: {
|
|
138
144
|
onClickItem(event, item, index) {
|
|
@@ -144,32 +150,29 @@ export default {
|
|
|
144
150
|
}
|
|
145
151
|
return value;
|
|
146
152
|
},
|
|
147
|
-
|
|
153
|
+
handleSelect(card) {
|
|
148
154
|
debugger;
|
|
149
|
-
navigateToPath.call(
|
|
150
|
-
this,
|
|
151
|
-
card?.selectedCard?.link.match(/https?:\/\/[^\/]+(\/[^?#]*)/)[1], // open link in current environment
|
|
152
|
-
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
153
|
-
);
|
|
154
|
-
this.$nextTick(() => this.$emit("selected-title"));
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
const isSolar = this.googleSearchFlag === "solar";
|
|
157
|
+
const link = card?.selectedCard?.link;
|
|
158
|
+
const openInNewTab = card?.ev?.ctrlKey || card?.ev?.metaKey;
|
|
159
|
+
|
|
160
|
+
// Extract pathname only for solar
|
|
161
|
+
const finalLink = isSolar ? link : link?.match(/https?:\/\/[^\/]+(\/[^?#]*)/)?.[1];
|
|
162
|
+
|
|
163
|
+
if (finalLink) {
|
|
164
|
+
navigateToPath.call(this, finalLink, openInNewTab);
|
|
158
165
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this,
|
|
164
|
-
card?.selectedCard?.link.match(/https?:\/\/[^\/]+(\/[^?#]*)/)[1], // title click is used for search result, but change also included here
|
|
165
|
-
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
166
|
-
);
|
|
167
|
-
this.$nextTick(() => this.$emit("selected"));
|
|
166
|
+
|
|
167
|
+
this.$nextTick(() => {
|
|
168
|
+
this.$emit(isSolar ? "selected" : "selected-title");
|
|
169
|
+
});
|
|
168
170
|
|
|
169
171
|
if (this.$gtm) {
|
|
170
172
|
this.fireGTM(card);
|
|
171
173
|
}
|
|
172
174
|
},
|
|
175
|
+
|
|
173
176
|
fireGTM(card) {
|
|
174
177
|
let attrs = {
|
|
175
178
|
location:
|
|
@@ -42,6 +42,9 @@
|
|
|
42
42
|
:offset="searchResults && searchResults.offset"
|
|
43
43
|
:page-limit="pageLimit"
|
|
44
44
|
:content-parser="contentParser"
|
|
45
|
+
:google-search-flag="searchType"
|
|
46
|
+
:is-selectable="searchType === 'solar'"
|
|
47
|
+
:is-card-title-selectable="searchType !== 'solar'"
|
|
45
48
|
@selected="$emit('selected')"
|
|
46
49
|
@pageChanged="pageChanged"
|
|
47
50
|
/>
|
|
@@ -231,9 +234,6 @@ export default {
|
|
|
231
234
|
}
|
|
232
235
|
},
|
|
233
236
|
onSearch(e) {
|
|
234
|
-
debugger;
|
|
235
|
-
console.log("this.searchType:- ", this.searchType);
|
|
236
|
-
|
|
237
237
|
const { path } = this.$route || {};
|
|
238
238
|
|
|
239
239
|
// Home page
|