wapi-doc/layout/own-scripts.js
/*
  Collapse or show a request/response example.
*/
Collapse or show a request/response example.
Collapse or show a request / response example .
function toggleCollapseButton(event) {
  var button = event.target.parentNode
  var content = button.parentNode.nextSibling
  var inner = content.children[0]
  if (button.className.indexOf('collapse-button') === -1) {
    return
  }
  if (content.style.maxHeight && content.style.maxHeight !== '0px') {
    button.className = 'collapse-button'
    content.style.maxHeight = '0px'
  } else {
    button.className = 'collapse-button show'
    content.style.maxHeight = inner.offsetHeight + 12 + 'px'
  }
}
function toggleCollapseButton ( event ) { var button = event . target . parentNode var content = button . parentNode . nextSibling var inner = content . children [ 0 ] if ( button . className . indexOf ( 'collapse-button' ) === - 1 ) { return } if ( content . style . maxHeight && content . style . maxHeight !== '0px' ) { button . className = 'collapse-button' content . style . maxHeight = '0px' } else { button . className = 'collapse-button show' content . style . maxHeight = inner . offsetHeight + 12 + 'px' } }
Collapse or show a request/response example.
Collapse or show a request / response example .
// Clicked without hitting the right element? // Currently showing, so let's hide it // Currently hidden, so let's show it