@worksafevictoria/wcl7.5 1.1.0-beta.46 → 1.1.0-beta.47

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": "@worksafevictoria/wcl7.5",
3
- "version": "1.1.0-beta.46",
3
+ "version": "1.1.0-beta.47",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -532,7 +532,7 @@ export default {
532
532
  }
533
533
  },
534
534
  backToTop() {
535
- if (!this.storybook) {
535
+ if (this.$bus) {
536
536
  this.$bus.$emit('scrollToTop')
537
537
  }
538
538
  },
@@ -511,7 +511,6 @@ export default {
511
511
  this.screenWidth()
512
512
  }
513
513
  if (this.$bus) {
514
- console.log('🚀 ~ this.$bus.$on ~ this.$bus:', this.$bus)
515
514
  this.$bus.$on('site-search', (query) => {
516
515
  this.searchQuery = query
517
516
  if (query) {
@@ -281,7 +281,7 @@ export default {
281
281
  // }
282
282
  },
283
283
  mounted() {
284
- if (this.$bus?.$on) {
284
+ if (this.$bus) {
285
285
  this.$bus.$on('scrollToTop', () => {
286
286
  setTimeout(() => {
287
287
  const title = this.$refs.title
@@ -294,7 +294,7 @@ export default {
294
294
  }
295
295
  },
296
296
  beforeDestroy() {
297
- if (this.$bus?.$off) {
297
+ if (this.$bus) {
298
298
  this.$bus.$off('scrollToTop')
299
299
  }
300
300
  },
@@ -122,9 +122,13 @@ export default {
122
122
  toggleAccordion() {
123
123
  this.showAccordion = !this.showAccordion
124
124
  if (this.showAccordion) {
125
- this.$bus.$emit('accordionItemOpen', this.meta) // this.$root.$emit('accordionItemOpen', this.meta)
125
+ if (this.$bus) {
126
+ this.$bus.$emit('accordionItemOpen', this.meta) // this.$root.$emit('accordionItemOpen', this.meta)
127
+ }
126
128
  } else {
127
- this.$bus.$emit('accordionItemClose', this.meta) // this.$root.$emit('accordionItemClose', this.meta)
129
+ if (this.$bus) {
130
+ this.$bus.$emit('accordionItemClose', this.meta) // this.$root.$emit('accordionItemClose', this.meta)
131
+ }
128
132
  }
129
133
  },
130
134
  },
@@ -198,7 +198,9 @@ export default {
198
198
  nextTabbedCard[0].focus()
199
199
  } else {
200
200
  let nextFocus = this.focusNextElement()
201
- this.$root.$emit('last-focus-out')
201
+ if (this.$bus) {
202
+ this.$bus.$emit('last-focus-out')
203
+ }
202
204
  nextFocus.focus()
203
205
  }
204
206
  } else {
@@ -442,7 +442,9 @@ export default {
442
442
  if (!isGovSite(card?.selectedCard?.link)) {
443
443
  // this.$store.commit('page/SET_CARETAKER_REF', 'list-group')
444
444
  // this.$root.$emit('caretaker-open', card?.selectedCard?.link)
445
- if (this.$pageStore) this.$pageStore.caretaker.referrer = 'list-group'
445
+ if (this.$pageStore) {
446
+ this.$pageStore.caretaker.referrer = 'list-group'
447
+ }
446
448
  if (this.$bus) {
447
449
  this.$bus.$emit('caretaker-open', card?.selectedCard?.link)
448
450
  }
@@ -498,7 +500,9 @@ export default {
498
500
  nextTabbedCard[0].focus()
499
501
  } else {
500
502
  let nextFocus = this.focusNextElement()
501
- this.$root.$emit('last-focus-out')
503
+ if (this.$bus) {
504
+ this.$bus.$emit('last-focus-out')
505
+ }
502
506
  nextFocus.focus()
503
507
  }
504
508
  } else {