mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 20:55:21 +00:00
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:
parent
4d5458cf4e
commit
c1891a3ee3
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
// Collapse callouts
|
// Collapse callouts
|
||||||
Array.from(document.querySelectorAll(".callout.is-collapsible")).forEach((elem) => {
|
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")) {
|
if (elem.classList.contains("is-collapsed")) {
|
||||||
elem.classList.remove("is-collapsed");
|
elem.classList.remove("is-collapsed");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user