nsw-design-system 3.18.8 → 3.18.9

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/dist/js/main.js CHANGED
@@ -368,14 +368,13 @@
368
368
  if (this.allBreadcrumbs.children.length > 3) {
369
369
  this.createToggle();
370
370
  }
371
- this.element.addEventListener('click', event => {
372
- event.preventDefault();
373
- this.allBreadcrumbs.classList.toggle('nsw-breadcrumbs__show-all');
374
- });
375
371
  }
376
372
  createToggle() {
377
373
  const toggle = this.constructor.createElement('li', ['nsw-breadcrumbs__show-more-toggle']);
378
374
  toggle.innerHTML = '<button aria-label="Show more breadcrumbs" class="nsw-breadcrumbs__toggle-button" type="button">…</button>';
375
+ toggle.addEventListener('click', () => {
376
+ this.allBreadcrumbs.classList.toggle('nsw-breadcrumbs__show-all');
377
+ });
379
378
  this.allBreadcrumbs.insertBefore(toggle, this.secondBreadcrumb);
380
379
  }
381
380
  static createElement(tag) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nsw-design-system",
3
- "version": "3.18.8",
3
+ "version": "3.18.9",
4
4
  "description": "Design system for Digital NSW",
5
5
  "main": "dist/js/main.js",
6
6
  "types": "dist/js/main.d.ts",
@@ -10,16 +10,14 @@ class Breadcrumbs {
10
10
  if (this.allBreadcrumbs.children.length > 3) {
11
11
  this.createToggle()
12
12
  }
13
-
14
- this.element.addEventListener('click', (event) => {
15
- event.preventDefault()
16
- this.allBreadcrumbs.classList.toggle('nsw-breadcrumbs__show-all')
17
- })
18
13
  }
19
14
 
20
15
  createToggle() {
21
16
  const toggle = this.constructor.createElement('li', ['nsw-breadcrumbs__show-more-toggle'])
22
17
  toggle.innerHTML = '<button aria-label="Show more breadcrumbs" class="nsw-breadcrumbs__toggle-button" type="button">…</button>'
18
+ toggle.addEventListener('click', () => {
19
+ this.allBreadcrumbs.classList.toggle('nsw-breadcrumbs__show-all')
20
+ })
23
21
 
24
22
  this.allBreadcrumbs.insertBefore(toggle, this.secondBreadcrumb)
25
23
  }