Resolve collapsible nested callouts (#80)

Previously:
When there are nested collapsible callouts, if you want to open a child one, by clicking on it, the parent one will close. You would have to re-open the parent one to see the now-open child callout.

Now:
To open and close a collapsible callout, you have to click on the "callout-title" div; resolve the problem with nested one. 
Live preview: https://voidblueprint.vercel.app/void-blueprint/physics/classic-physics/electro-magnetism/charge-conservation-law/
This commit is contained in:
12-VidE 2023-02-18 19:40:50 +01:00 committed by GitHub
parent 4d5458cf4e
commit c1891a3ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@
// Collapse callouts
Array.from(document.querySelectorAll(".callout.is-collapsible")).forEach((elem) => {
elem.addEventListener("click", (event) => {
elem.querySelector('.callout-title').addEventListener("click", (event) => {
if (elem.classList.contains("is-collapsed")) {
elem.classList.remove("is-collapsed");
} else {
@ -38,4 +38,4 @@
});
});
});
</script>
</script>