update from sparkleup
This commit is contained in:
parent
b7a10730ee
commit
1ca2905ec9
Binary file not shown.
|
@ -233,6 +233,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
<span class="control">Expand all</span>
|
||||||
</article>
|
</article>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Page generated on 2020-04-08 16:11</p>
|
<p>Page generated on 2020-04-08 16:11</p>
|
||||||
|
@ -261,6 +262,22 @@ document.querySelectorAll('li.has-nested').forEach(el => {
|
||||||
el.querySelector('.toggle').addEventListener('click', () => {
|
el.querySelector('.toggle').addEventListener('click', () => {
|
||||||
el.classList.toggle('closed');
|
el.classList.toggle('closed');
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
let expanded = false;
|
||||||
|
document.querySelector('.control').addEventListener('click', (e) => {
|
||||||
|
expanded = !expanded;
|
||||||
|
if (expanded) {
|
||||||
|
e.target.innerText = 'Collapse all';
|
||||||
|
} else {
|
||||||
|
e.target.innerText = 'Expand all';
|
||||||
|
}
|
||||||
|
document.querySelectorAll('.has-nested').forEach((el) => {
|
||||||
|
if (expanded) {
|
||||||
|
el.classList.remove('closed');
|
||||||
|
} else {
|
||||||
|
el.classList.add('closed')
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue