nsw-design-system 3.18.7 → 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) {
@@ -5171,11 +5170,12 @@
5171
5170
  copiedMessage(element) {
5172
5171
  this.copyElement = element;
5173
5172
  const icon = '<span class="material-icons nsw-material-icons" focusable="false" aria-hidden="true">link</span>';
5173
+ const originalText = this.copyElement.innerHTML;
5174
5174
  this.copyElement.classList.add('copied');
5175
5175
  this.copyElement.innerHTML = `${icon} Copied`;
5176
5176
  setTimeout(() => {
5177
5177
  this.copyElement.classList.remove('copied');
5178
- this.copyElement.innerHTML = `${icon} Copy link`;
5178
+ this.copyElement.innerHTML = originalText;
5179
5179
  }, 3000);
5180
5180
  }
5181
5181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nsw-design-system",
3
- "version": "3.18.7",
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
  }
@@ -152,11 +152,14 @@ class UtilityList extends Toggletip {
152
152
  copiedMessage(element) {
153
153
  this.copyElement = element
154
154
  const icon = '<span class="material-icons nsw-material-icons" focusable="false" aria-hidden="true">link</span>'
155
+ const originalText = this.copyElement.innerHTML
156
+
155
157
  this.copyElement.classList.add('copied')
156
158
  this.copyElement.innerHTML = `${icon} Copied`
159
+
157
160
  setTimeout(() => {
158
161
  this.copyElement.classList.remove('copied')
159
- this.copyElement.innerHTML = `${icon} Copy link`
162
+ this.copyElement.innerHTML = originalText
160
163
  }, 3000)
161
164
  }
162
165
  }