FAQ: acordeón (al abrir una respuesta se cierra la anterior)
This commit is contained in:
1 parent
79627ec104
commit
13693530a9
1 file changed
+7
@@ -237,6 +237,13 @@ if (langBox) {
|
|||||||
applyLang();
|
applyLang();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Accordion: only one answer open at a time
|
||||||
|
el('list').addEventListener('toggle', (ev) => {
|
||||||
|
const d = ev.target;
|
||||||
|
if (!d || d.tagName !== 'DETAILS' || !d.open) return;
|
||||||
|
el('list').querySelectorAll('details[open]').forEach(o => { if (o !== d) o.open = false; });
|
||||||
|
}, true);
|
||||||
|
|
||||||
el('q').addEventListener('input', render);
|
el('q').addEventListener('input', render);
|
||||||
|
|
||||||
applyLang();
|
applyLang();
|
||||||
|
|||||||
Reference in new issue
Block a user