@@ -20,7 +20,16 @@ <h1><a class="entity-name" href="{{ site.baseurl }}/api/{{ pkg.path | join: "/"
20
20
{% for member in pkg.children %}
21
21
{% if member.kind == "object" and member.hasCompanion %}
22
22
{% elsif member.kind != "package" %}
23
+
24
+ {% if forloop.index == 6 and forloop.length > 7 %}
25
+ < li id ="show-hidden-by-default " onclick ="toggleHiddenByDefault(this); "> + expand rest</ li >
26
+ < li class ="hidden-by-default {% if member.hasCompanion %} with-companion {% endif %} ">
27
+ {% elsif forloop.index > 6 and forloop.length > 7 %}
28
+ < li class ="hidden-by-default {% if member.hasCompanion %} with-companion {% endif %} ">
29
+ {% else %}
23
30
< li class ="{% if member.hasCompanion %} with-companion {% endif %} ">
31
+ {% endif %}<!-- end li setter -->
32
+
24
33
< div class ="entity-kinds ">
25
34
{% if member.hasCompanion %}
26
35
< a class ="letter-anchor object " href ="{{ site.baseurl }}/api/{{ member.companionPath | join: "/" }}.html"> O</ a >
@@ -29,10 +38,28 @@ <h1><a class="entity-name" href="{{ site.baseurl }}/api/{{ pkg.path | join: "/"
29
38
</ div >
30
39
< a class ="entity-name " href ="{{ site.baseurl }}/api/{{ member.path | join: "/" }}.html"> {{ member.name }}</ a >
31
40
</ li >
41
+
42
+ {% if forloop.last and forloop.index > 6 %}
43
+ < li id ="hide-hidden-by-default " onclick ="toggleHiddenByDefault(this); "> - collapse members</ li >
32
44
{% endif %}
45
+
46
+ {% endif %} <!-- end != "package" -->
47
+
33
48
{% endfor %}
34
49
</ ul >
35
50
</ li >
36
51
{% endfor %}
37
52
</ ul >
38
53
</ div >
54
+ < script >
55
+ function toggleHiddenByDefault ( li ) {
56
+ var ul = li . parentElement ;
57
+
58
+ for ( var i = 0 ; i < ul . children . length ; i ++ ) {
59
+ var childLi = ul . children [ i ] ;
60
+ if ( childLi . classList . contains ( 'hidden-by-default' ) || childLi . id == "hide-hidden-by-default" || childLi . id == "show-hidden-by-default" ) {
61
+ childLi . classList . toggle ( 'toggled' ) ;
62
+ }
63
+ }
64
+ }
65
+ </ script >
0 commit comments