cec-nuxt-lib 0.6.7 → 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.7"
4
+ "version": "0.6.9"
5
5
  }
@@ -116,35 +116,54 @@ onMounted(() => {
116
116
  } catch (ignore) {
117
117
  console.log('No reachdeck.');
118
118
  }
119
- });
120
119
 
121
- // Make accordions spring open if there is a hash (looks for an H3)
122
- let hash = window.location.hash;
123
- if (hash) {
124
- hash = hash.toLowerCase().replace(/^#/, '').replace(/_/g, ' ');
125
- Array.from(document.getElementsByTagName('H3'))
126
- .filter((e) => e.innerHTML.toLowerCase().includes(hash))
127
- .forEach((h3, i) => {
128
- let parent = h3.parentNode;
129
- if (parent.tagName === 'ARTICLE') {
130
- let el = parent.previousElementSibling;
131
- let input =
132
- el.tagName === 'LABEL'
133
- ? el.control
134
- : el.tagName === 'INPUT'
135
- ? el
136
- : undefined;
137
- if (input) {
138
- input.checked = true;
139
- if (!i) {
140
- el.scrollIntoView();
120
+ // Make accordions spring open if there is a hash (looks for an H3)
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
+ }
138
+ }
141
139
  }
142
- }
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
+ });
143
162
  }
144
- });
145
- }
163
+ }
164
+ }
146
165
 
147
- // Canvas stuff
166
+ // Canvas stuff
148
167
  const getQuInfo = (b) => {
149
168
  let temp = b.id.split('_');
150
169
  let id = temp[3];
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.7",
2
+ "version": "0.6.9",
3
3
  "name": "cec-nuxt-lib",
4
4
  "description": "Nuxt components and assets",
5
5
  "license": "MIT",