aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2017-10-06 05:53:28 +0200
committerache <ache@ache.one>2017-10-06 05:53:28 +0200
commit5a7ca62e7fa31f767c611ab9ab172a694faff95a (patch)
tree515b261d5e074cef9949c321a85905f39a46076f
parentuncaughtException (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.js2
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");
}