Fix OTS warning about `maxp.maxSizeOfInstructions`.
[ttfautohint.git] / doc / toc-unfold.js
blobad1180a1a90153ff45dd84a1e227a98cdd94eb8d
1 /*!
2  * toc-unfold.js
3  *
4  * JavaScript code to fold and unfold TOC entries
5  *
6  * written 2014 by Werner Lemberg
7  */
9 // This code snippet needs `jquery' (https://code.jquery.com)
11 $(document).ready(function() {
12   TOC.setup();
13 });
15 var TOC = {
16   setup: function() {
17     /* decorate TOC's `li' elements that have children with `folded' class */
18     /* (pandoc doesn't do this) */
19     $("#TOC li").each(function(i) {
20       if ($(this).children().length) {
21         $(this).addClass("folded");
22       }
23     });
25     /* fold all entries */
26     $(".folded").each(function(i) {
27       $(this).children("ul:first").hide();
28     });
30     /* change class to `unfolded' if clicked */
31     $(".folded").click(function(e) {
32       $(this).toggleClass("unfolded");
33       $(this).children("ul:first").slideToggle("300");
34       e.stopPropagation();
35     });  
36   }