diff options
author | ache <ache@ache.one> | 2017-10-06 05:53:28 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2017-10-06 05:53:28 +0200 |
commit | 5a7ca62e7fa31f767c611ab9ab172a694faff95a (patch) | |
tree | 515b261d5e074cef9949c321a85905f39a46076f | |
parent | uncaughtException (diff) |
Accessibility fix
Accessibility to non mouse-based devices. With mice, you have to click
on the li elem. With keyboards, you can't. With this fix, you can use
'tab' to select an li elem so even without a mouse you can select a li.
-rw-r--r-- | public/js/script.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/public/js/script.js b/public/js/script.js index 432fcf5..4c9769a 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -18,6 +18,7 @@ $(document).ready(function() { }); }); + function addDirectory(data) { var ul = document.createElement('ul'); data.children.forEach(function(item) { @@ -32,6 +33,7 @@ function addDirectory(data) { li.classList.add("file"); } else { li.appendChild(text); + li.tabIndex = 0 li.appendChild(addDirectory(item)); li.classList.add("directory"); } |