Add javascript to open table of contents on click.
authorRick Frankel <rick@rickster.com>
Thu, 16 May 2013 21:41:55 +0000 (17:41 -0400)
committerRick Frankel <rick@rickster.com>
Thu, 16 May 2013 21:41:55 +0000 (17:41 -0400)
* preamble.html: Add javascript so the table of contents can be open
  with a click as well as mouse-over (for tablets.)

preamble.html

index 74a6a72..05fd3cb 100644 (file)
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
 
+  document.addEventListener('DOMContentLoaded',function() {
+      document.getElementById("table-of-contents").onclick = function() {
+          var elem = document.getElementById("text-table-of-contents");
+          elem.style.display = elem.style.display == "block" ? "none" : "block";
+      }
+  });
 </script>