update from sparkleup
This commit is contained in:
parent
4bc425a9d3
commit
72f6367d8e
Binary file not shown.
|
@ -239,14 +239,14 @@
|
|||
</footer>
|
||||
</main>
|
||||
<style>
|
||||
.has-nested:before {
|
||||
.has-nested .toggle:before {
|
||||
content: '▼';
|
||||
}
|
||||
.has-nested.closed:before {
|
||||
.has-nested.closed .toggle:before {
|
||||
content: '▶';
|
||||
}
|
||||
.has-nested.closed {
|
||||
max-height: 16pt;
|
||||
max-height: calc(16pt*1.2);
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
@ -254,14 +254,14 @@
|
|||
document.querySelectorAll('li').forEach(el => {
|
||||
if (el.querySelectorAll('li').length !== 0) {
|
||||
el.classList.add('has-nested', 'closed');
|
||||
el.innerHTML = `<span class="toggle"></span> ${el.innerHTML}`;
|
||||
}
|
||||
});
|
||||
document.querySelectorAll('li.has-nested').forEach(el => {
|
||||
el.querySelector(':before').addEventListener('click', () => {
|
||||
el.querySelector('.toggle').addEventListener('click', () => {
|
||||
el.classList.toggle('closed');
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue