From 5a7ca62e7fa31f767c611ab9ab172a694faff95a Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 6 Oct 2017 05:53:28 +0200 Subject: 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. --- public/js/script.js | 2 ++ 1 file changed, 2 insertions(+) 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"); } -- cgit v1.2.3