Skip to content

Commit ec7904b

Browse files
committed
Add navigation toggle animation
FIXME: should be replaced with Vanilla JS and CSS
1 parent 79b8107 commit ec7904b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/assets/js/app.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ $(() => {
66
// highlight.js
77
hljs.highlightAll();
88

9-
$("#navigation").load(`${config.rootPath}navigation.html`, function() {
10-
$(".sidebar-sticky .icon").on("click", function (e) {
11-
$(this).siblings("ul").toggle();
9+
$("#navigation").load(`${config.rootPath}navigation.html`, () => {
10+
// Toggle child lists
11+
$(".sidebar-sticky .icon").on("click", function () {
12+
// FIXME: use vanilla JS and CSS instead of jQuery
13+
$(this).siblings("ul").toggle(500);
1214
this.classList.toggle("icon-opened");
1315
});
16+
17+
// Activate current page
1418
$(`.sidebar-content a[href='${window.location.pathname}']`)
1519
.attr("class", "active-link")
1620
.parents('ul')

0 commit comments

Comments
 (0)