Skip to content

Commit

Permalink
All Examples: Add JumpTo menu button to implement WCAG bypass blocks …
Browse files Browse the repository at this point in the history
…requirement (pull #1923)

Modifies examples.js to include script that adds a menu button to the top of every example page.
The menu supports moving focus to each landmark region and each H1 or H2 on the page.
  • Loading branch information
jongund authored Jul 18, 2021
1 parent a4fddcb commit b7383b7
Show file tree
Hide file tree
Showing 3 changed files with 1,220 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"npm"
],
"words": [
"accesskey",
"Accesskey",
"activedescendants",
"affordance",
"alertdialog",
Expand Down Expand Up @@ -99,6 +101,7 @@
"jarosewli",
"Jèrôme",
"Jinyuan",
"jumpto",
"Kasper",
"kbdshortcuts",
"Kowno",
Expand Down
11 changes: 11 additions & 0 deletions examples/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,14 @@
});
}
})();

// Add jumpto.js to examples
(function () {
let ref = window.location.href.split('examples')[0];
if (ref) {
let head = document.getElementsByTagName('head')[0];
let scriptNode = document.createElement('script');
scriptNode.setAttribute('src', ref + 'examples/js/jumpto.js');
head.appendChild(scriptNode);
}
})();
Loading

0 comments on commit b7383b7

Please sign in to comment.