Skip to content

Commit

Permalink
Handle subsections correctly when hiding and showing sections
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Sep 11, 2024
1 parent b4ae026 commit c15796e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions content_editor/static/content_editor/content_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,17 +717,17 @@
/* Could have been hidden through sections */
inline.classList.remove("order-machine-hide")
}
hideChildren(inline, collapsed)
hideSection(inline, collapsed)
}

function hideChildren(inline, hide = true) {
function hideSection(inline, hide = true) {
const children = childrenMap && childrenMap.get(inline)
if (children) {
for (let child of children) {
child.classList.toggle("content-editor-hide", hide)
if (hide) {
/* Hiding is recursive */
hideChildren(child)
if (hide || !child.classList.contains("collapsed")) {
/* Hiding is recursive, showing uncollapsed child sections too */
hideSection(child, hide)
}
}
}
Expand Down

0 comments on commit c15796e

Please sign in to comment.