Skip to content

Commit 3f5c0a9

Browse files
committed
Add navbar toggling on outside click in learn app
1 parent f6fae74 commit 3f5c0a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

learn/templates/learn/layout.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ <h5>Preprocessing</h5>
189189
imgs.forEach(img => {
190190
img.classList.add('img-fluid');
191191
});
192+
// Close chapter links on click outside
193+
document.addEventListener('click', (e) => {
194+
if (!e.target.closest('.chapters')) {
195+
toggleChapterLinks();
196+
}
197+
});
192198
}
193199
</script>
194200
{% block script %}{% endblock %}

0 commit comments

Comments
 (0)