-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] TAB navigation for menu and focus target section after click
- Loading branch information
1 parent
d107d8c
commit ac7ad02
Showing
11 changed files
with
34 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<ea:asset.css embed="1" priority="1" identifier="hmbrgr" href="EXT:microtemplate/Resources/Public/Css/Menus/hmbrgr.css" /> | ||
|
||
<button id="hmbrgr" class="hmbrgr" aria-label="Menu" style="display: none"></button> | ||
<button id="hmbrgr" class="hmbrgr" aria-label="Collapse or expand the menu" aria-haspopup="true" aria-expanded="false" style="display: none"></button> | ||
|
||
<ea:asset.script embed="1" identifier="hmbrgr" src="EXT:microtemplate/Resources/Public/JavaScript/Menus/hmbrgr.js" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<f:if condition="{rootPageId}"> | ||
<f:then><f:link.page pageUid="{rootPageId}" title="Close" class="closelink"></f:link.page></f:then> | ||
<f:else><f:link.page pageUid="{site.rootPageId}" title="Close" class="closelink"></f:link.page></f:else> | ||
<f:then><f:link.page pageUid="{rootPageId}" title="Back to main page" aria-label="Back to main page" class="closelink"></f:link.page></f:then> | ||
<f:else><f:link.page pageUid="{site.rootPageId}" title="Back to main page" aria-label="Back to main page" class="closelink"></f:link.page></f:else> | ||
</f:if> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
const hmbrgr = document.getElementById('hmbrgr'); | ||
const menu = document.getElementById('menu'); | ||
const menuLinks = menu.querySelectorAll('a'); | ||
|
||
hmbrgr.addEventListener('click', () => { | ||
hmbrgr.classList.toggle('open'); | ||
menu.classList.toggle('open'); | ||
if(hmbrgr.classList.contains('open')) { | ||
hmbrgr.setAttribute("aria-expanded", "true"); | ||
menuLinks.forEach(link => { | ||
link.setAttribute('tabindex', '0'); | ||
}); | ||
} else { | ||
hmbrgr.setAttribute("aria-expanded", "false"); | ||
menuLinks.forEach(link => { | ||
link.setAttribute('tabindex', '-1'); | ||
}); | ||
} | ||
}); | ||
|
||
hmbrgr.style.display = "block"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters