assets/scripts/main.js in wai-website-theme-1.3.1 vs assets/scripts/main.js in wai-website-theme-1.4

- old
+ new

@@ -370,9 +370,16 @@ if (target && target.nodeName.toLowerCase() == 'details') { target.setAttribute('open', 'true'); target = target.parentNode; } + // if the target is in a summary, it is a heading with an id. In that case we want to open the details that is the parent. + + if (target && target.parentNode.nodeName.toLowerCase() == 'summary') { + target.parentNode.parentNode.setAttribute('open', 'true'); + target = target.parentNode.parentNode; + } + // can see if that parent node is visible. If it is _not_, but is a details element, we open that details element. // Then we move on to its parent until we arrive at a visible element while (!isVisible(target)) { if (target.nodeName.toLowerCase() == 'details') { target.setAttribute('open', 'true'); \ No newline at end of file