mostly good for release
This commit is contained in:
parent
8fc7eff67b
commit
b626e6265e
32 changed files with 425 additions and 169 deletions
|
@ -1,12 +1,13 @@
|
|||
const detailsElements = document.getElementsByTagName('details');
|
||||
const dropdown = Array.from(detailsElements);
|
||||
|
||||
const save = () => {
|
||||
Array.from(detailsElements).forEach((details, i) => {
|
||||
dropdown.forEach((details, i) => {
|
||||
localStorage.setItem(`details${i}`, details.hasAttribute('open'));
|
||||
});
|
||||
};
|
||||
|
||||
Array.from(detailsElements).forEach((details, i) => {
|
||||
dropdown.forEach((details, i) => {
|
||||
const isOpen = JSON.parse(localStorage.getItem(`details${i}`)) || false;
|
||||
details.toggleAttribute('open', isOpen);
|
||||
details.addEventListener('toggle', save);
|
||||
|
@ -18,7 +19,7 @@ Array.from(detailsElements).forEach((details, i) => {
|
|||
});
|
||||
|
||||
setTimeout(() => {
|
||||
Array.from(detailsElements).forEach(details => {
|
||||
dropdown.forEach(details => {
|
||||
const svg = details.querySelector('summary svg');
|
||||
if (svg) svg.style.transition = '';
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue