cec-nuxt-lib 0.6.8 → 0.6.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/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "cec-nuxt-lib",
3
3
  "configKey": "cec-nuxt-lib",
4
- "version": "0.6.8"
4
+ "version": "0.6.9"
5
5
  }
@@ -118,29 +118,49 @@ onMounted(() => {
118
118
  }
119
119
 
120
120
  // Make accordions spring open if there is a hash (looks for an H3)
121
- let hash = window.location.hash;
122
- if (hash) {
123
- hash = hash.toLowerCase().replace(/^#/, '').replace(/_/g, ' ');
124
- Array.from(document.getElementsByTagName('H3'))
125
- .filter((e) => e.innerHTML.toLowerCase().includes(hash))
126
- .forEach((h3, i) => {
127
- let parent = h3.parentNode;
128
- if (parent.tagName === 'ARTICLE') {
129
- let el = parent.previousElementSibling;
130
- let input =
131
- el.tagName === 'LABEL'
132
- ? el.control
133
- : el.tagName === 'INPUT'
134
- ? el
135
- : undefined;
136
- if (input) {
137
- input.checked = true;
138
- if (!i) {
139
- el.scrollIntoView();
121
+ let accordions = document.getElementsByClassName('access-acc-container');
122
+ if (accordions.length) {
123
+ let hash = window.location.hash;
124
+ let found = false;
125
+ if (hash) {
126
+ hash = hash.toLowerCase().replace(/^#/, '').replace(/_/g, ' ');
127
+ Array.from(document.getElementsByTagName('LABEL'))
128
+ .filter((e) => e.innerHTML.toLowerCase().includes(hash))
129
+ .forEach((l, i) => {
130
+ if (l.parentNode.tagName === 'SECTION') {
131
+ let el = l.previousElementSibling;
132
+ if (el.tagName === 'INPUT') {
133
+ el.checked = true;
134
+ if (!i) {
135
+ el.scrollIntoView();
136
+ found = true;
137
+ }
140
138
  }
141
139
  }
142
- }
143
- });
140
+ });
141
+ if (!found) {
142
+ Array.from(document.getElementsByTagName('H3'))
143
+ .filter((e) => e.innerHTML.toLowerCase().includes(hash))
144
+ .forEach((h3, i) => {
145
+ let parent = h3.parentNode;
146
+ if (parent.tagName === 'ARTICLE') {
147
+ let el = parent.previousElementSibling;
148
+ let input =
149
+ el.tagName === 'LABEL'
150
+ ? el.control
151
+ : el.tagName === 'INPUT'
152
+ ? el
153
+ : undefined;
154
+ if (input) {
155
+ input.checked = true;
156
+ if (!i) {
157
+ el.scrollIntoView();
158
+ }
159
+ }
160
+ }
161
+ });
162
+ }
163
+ }
144
164
  }
145
165
 
146
166
  // Canvas stuff
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.8",
2
+ "version": "0.6.9",
3
3
  "name": "cec-nuxt-lib",
4
4
  "description": "Nuxt components and assets",
5
5
  "license": "MIT",