We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 070a695 + 822bd1f commit 1704495Copy full SHA for 1704495
2 files changed
static/js/page.js
@@ -0,0 +1,12 @@
1
+document.addEventListener('DOMContentLoaded', function() {
2
+ const mainNavHashLinks = document.querySelectorAll(
3
+ 'rh-navigation-primary-item[href^="#"], rh-navigation-primary-item > a[href^="#"]'
4
+ );
5
+
6
+ // Close dropdowns after clicking an in-page link on mobile viewports
7
+ for (let hashLink of mainNavHashLinks) {
8
+ hashLink.addEventListener('click', function() {
9
+ hashLink.closest('rh-navigation-primary').close();
10
+ });
11
+ }
12
+});
templates/index.html
@@ -116,6 +116,7 @@ <h3 class="header">{{ elem.heading }}</h3>
116
117
{% include "partials/_footer.html" %}
118
119
+<script src="/js/page.js"></script>
120
<script src="/js/table-search.js"></script>
121
<script src="/js/rht-picture.js"></script>
122
0 commit comments