summaryrefslogtreecommitdiffstats
path: root/static/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/script.js')
-rw-r--r--static/script.js31
1 files changed, 6 insertions, 25 deletions
diff --git a/static/script.js b/static/script.js
index 00962e5..846c842 100644
--- a/static/script.js
+++ b/static/script.js
@@ -1,28 +1,9 @@
1'use strict'; 1"use strict";
2 2
3// 3//
4 4
5document.addEventListener('DOMContentLoaded', () => { 5document.addEventListener("DOMContentLoaded", () => {
6 document.querySelectorAll('.is-indeterminate').forEach(el => el.indeterminate = true); 6 document
7}) 7 .querySelectorAll(".is-indeterminate")
8 8 .forEach((el) => (el.indeterminate = true));
9// 9});
10
11const enableFocusIndicator = e => {
12 if (e.key !== 'Tab') {
13 return;
14 }
15
16 document.body.classList.add('t-keyboard');
17 document.removeEventListener('keydown', enableFocusIndicator);
18 document.addEventListener('mousedown', disableFocusIndicator);
19}
20
21const disableFocusIndicator = () => {
22 document.body.classList.remove('t-keyboard');
23
24 document.removeEventListener('mousedown', disableFocusIndicator);
25 document.addEventListener('keydown', enableFocusIndicator);
26}
27
28document.addEventListener('keydown', enableFocusIndicator);