Commit 81f123e 1 parent b14a999 commit 81f123e Copy full SHA for 81f123e
File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 12
12
<!-- The button background is to hide any content that is behind the trigger -->
13
13
< div class ="button-background "> </ div >
14
14
< div class ="button-wrapper ">
15
- < button aria-controls ="va-detailpage-sidebar ">
15
+ < button aria-controls ="va-detailpage-sidebar " id =" open-sidebar-dialog " >
16
16
< strong > In this section</ strong >
17
17
< va-icon icon ="menu " size ="3 " class ="vads-u-color--link-default "> </ va-icon >
18
18
</ button >
Original file line number Diff line number Diff line change 1
1
<nav data-template =" navigation/sidebar_nav" aria-label =" Secondary" id =" va-detailpage-sidebar" data-drupal-sidebar =" true" class =" va-drupal-sidebarnav usa-width-one-fourth va-sidebarnav" >
2
- <div aria-modal =" true" aria-labelledby =" sidebar_header" >
3
- <dialog >
2
+ <dialog aria-modal =" true" aria-labelledby =" sidebar_header" id =" sidebar-dialog" >
4
3
<button class =" va-sidenav-btn-close va-sidebarnav-close" type =" button" aria-label =" Close this menu" >
5
4
<va-icon icon =" close" size =" 3" class =" vads-u-color--gray-dark" ></va-icon >
6
5
</button >
7
6
<script >
7
+ const dialog = document .getElementById (' sidebar-dialog' );
8
+ const openBtn = document .getElementById (" open-sidebar-dialog" )
9
+
10
+ openBtn .addEventListener (' click' , () => {
11
+ dialog .showModal ();
12
+ });
13
+
14
+
8
15
document .addEventListener (' keydown' , function (event ) {
9
16
if (event .key === ' Escape' ) {
10
17
const sidebar = document .getElementById (' va-detailpage-sidebar' );
117
124
{% endfor %}
118
125
119
126
</dialog >
120
- </div >
121
127
</nav >
You can’t perform that action at this time.
0 commit comments