test-summary.js.html 3.75 KB
Newer Older
TJ Horner's avatar
TJ Horner committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../../../../">
  <title data-ice="title">node-launchpad-mk2/doc/script/test-summary.js | API Document</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
  <script src="script/prettify/prettify.js"></script>
  
  
  <script src="script/manual.js"></script>
</head>
<body class="layout-container" data-ice="rootContainer">

<header>
  <a href="./">Home</a>
  
  <a href="identifiers.html">Reference</a>
  <a href="source.html">Source</a>
  
  <a data-ice="repoURL" href="https://github.com/tjhorner/node-launchpad-mk2" class="repo-url-github">Repository</a>
  <div class="search-box">
  <span>
    <img src="./image/search.png">
    <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
  </span>
    <ul class="search-result"></ul>
  </div>
</header>

<nav class="navigation" data-ice="nav"><div>
  <ul>
    
  </ul>
</div>
</nav>

<div class="content" data-ice="content"><h1 data-ice="title">node-launchpad-mk2/doc/script/test-summary.js</h1>
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">(function(){
  function toggle(ev) {
    var button = ev.target;
    var parent = ev.target.parentElement;
    while(parent) {
      if (parent.tagName === &apos;TR&apos; &amp;&amp; parent.classList.contains(&apos;test-describe&apos;)) break;
      parent = parent.parentElement;
    }

    if (!parent) return;

    var direction;
    if (button.classList.contains(&apos;opened&apos;)) {
      button.classList.remove(&apos;opened&apos;);
      button.classList.add(&apos;closed&apos;);
      direction = &apos;closed&apos;;
    } else {
      button.classList.remove(&apos;closed&apos;);
      button.classList.add(&apos;opened&apos;);
      direction = &apos;opened&apos;;
    }

    var targetDepth = parseInt(parent.dataset.testDepth, 10) + 1;
    var nextElement = parent.nextElementSibling;
    while (nextElement) {
      var depth = parseInt(nextElement.dataset.testDepth, 10);
      if (depth &gt;= targetDepth) {
        if (direction === &apos;opened&apos;) {
          if (depth === targetDepth)  nextElement.style.display = &apos;&apos;;
        } else if (direction === &apos;closed&apos;) {
          nextElement.style.display = &apos;none&apos;;
          var innerButton = nextElement.querySelector(&apos;.toggle&apos;);
          if (innerButton &amp;&amp; innerButton.classList.contains(&apos;opened&apos;)) {
            innerButton.classList.remove(&apos;opened&apos;);
            innerButton.classList.add(&apos;closed&apos;);
          }
        }
      } else {
        break;
      }
      nextElement = nextElement.nextElementSibling;
    }
  }

  var buttons = document.querySelectorAll(&apos;.test-summary tr.test-describe .toggle&apos;);
  for (var i = 0; i &lt; buttons.length; i++) {
    buttons[i].addEventListener(&apos;click&apos;, toggle);
  }

  var topDescribes = document.querySelectorAll(&apos;.test-summary tr[data-test-depth=&quot;0&quot;]&apos;);
  for (var i = 0; i &lt; topDescribes.length; i++) {
    topDescribes[i].style.display = &apos;&apos;;
  }
})();
</code></pre>

</div>

<footer class="footer">
  Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.5.2)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>

<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>