Skip to content

Commit edce06a

Browse files
committed
Update navigation function
1 parent ba4a370 commit edce06a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

webpack/js/main.js

+12
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ $(document).ready(function () {
3232
$(".navbar-item.has-dropdown.is-active").removeClass('is-active');
3333
}
3434
});
35+
36+
// Internal Navigation for table of contents component
37+
let hash = window.location.hash;
38+
if (hash.length > 0) {
39+
$('.menu-list').find('a[href=\"' + hash + '\"]').addClass('is-active');
40+
}
41+
42+
$(window).on('hashchange', function() {
43+
let hash = window.location.hash;
44+
$('.menu-list a[href*="#"]').closest('a').removeClass('is-active');
45+
$('.menu-list').find('a[href=\"' + hash + '\"]').addClass('is-active');
46+
});
3547
});
3648

3749
const getFullyQualifiedUrl = (path, version) => {

0 commit comments

Comments
 (0)