Skip to content

Commit 2321fea

Browse files
committed
Add missing javascript handler for collapsing and expanding navigation items.
1 parent 193108f commit 2321fea

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

docs/_layouts/api-doc.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,21 @@ <h4 onclick="toggleNavigation('{{ chapter.id }}')">
121121
allow-try="false"
122122
heading-text="Pledger API"></rapi-doc>
123123
</div>
124-
</main>
124+
</main>
125+
126+
<script type="application/javascript">
127+
function toggleNavigation(id) {
128+
const section = document.getElementById(id);
129+
const children = section.querySelector('.children');
130+
131+
if (children.classList.contains('expanded')) {
132+
children.classList.remove('expanded');
133+
section.querySelector('img').src = '/images/icons/nav-chevron-right.png';
134+
} else {
135+
children.classList.add('expanded');
136+
section.querySelector('img').src = '/images/icons/nav-chevron-down.png';
137+
}
138+
}
139+
</script>
140+
</body>
141+
</html>

0 commit comments

Comments
 (0)