wapi-doc/layout/own-scripts.js
/*
  Collapse or show a navigation menu. It will not be hidden unless it
  is currently selected or `force` has been passed.
*/
Collapse or show a navigation menu. It will not be hidden unless it
is currently selected or `force` has been passed.
Collapse or show a navigation menu . It will not be hidden unless it is currently selected or ` force ` has been passed .
function toggleCollapseNav(event, force) {
  var heading = event.target.parentNode
  var content = heading.nextSibling
  var inner = content.children[0]
  if (heading.className.indexOf('heading') === -1) {
    return
  }
  if (content.style.maxHeight && content.style.maxHeight !== '0px') {
    if (
      force ||
      (window.location.hash &&
        endsWith(event.target.href, window.location.hash))
    ) {
      content.style.maxHeight = '0px'
    }
  } else {
    content.style.maxHeight = inner.offsetHeight + 12 + 'px'
  }
}
function toggleCollapseNav ( event , force ) { var heading = event . target . parentNode var content = heading . nextSibling var inner = content . children [ 0 ] if ( heading . className . indexOf ( 'heading' ) === - 1 ) { return } if ( content . style . maxHeight && content . style . maxHeight !== '0px' ) { if ( force || ( window . location . hash && endsWith ( event . target . href , window . location . hash ) ) ) { content . style . maxHeight = '0px' } } else { content . style . maxHeight = inner . offsetHeight + 12 + 'px' } }
Collapse or show a navigation menu.
Collapse or show a navigation menu .
// Clicked without hitting the right element? // Currently showing, so let's hide it, but only if this nav item // is already selected. This prevents newly selected items from // collapsing in an annoying fashion. // Currently hidden, so let's show it