summaryrefslogtreecommitdiffstats
path: root/static
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2022-02-05 12:26:35 +0100
committerVolpeon <git@volpeon.ink>2022-02-05 12:26:35 +0100
commit144b7a2ea83507c98544d14ad9435cc5e51ac071 (patch)
tree7b18227482fa9f5d29d358ce1540b7a6d105febd /static
parentInit (diff)
downloadiro-design-144b7a2ea83507c98544d14ad9435cc5e51ac071.tar.gz
iro-design-144b7a2ea83507c98544d14ad9435cc5e51ac071.tar.bz2
iro-design-144b7a2ea83507c98544d14ad9435cc5e51ac071.zip
Update
Diffstat (limited to 'static')
-rw-r--r--static/script.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/static/script.js b/static/script.js
new file mode 100644
index 0000000..ece93e8
--- /dev/null
+++ b/static/script.js
@@ -0,0 +1,26 @@
1'use strict';
2
3//
4
5document.querySelectorAll('.is-indeterminate').forEach(el => el.indeterminate = true);
6
7//
8
9const enableFocusIndicator = e => {
10 if (e.key !== 'Tab') {
11 return;
12 }
13
14 document.body.classList.add('t-keyboard');
15 document.removeEventListener('keydown', enableFocusIndicator);
16 document.addEventListener('mousedown', disableFocusIndicator);
17}
18
19const disableFocusIndicator = e => {
20 document.body.classList.remove('t-keyboard');
21
22 document.removeEventListener('mousedown', disableFocusIndicator);
23 document.addEventListener('keydown', enableFocusIndicator);
24}
25
26document.addEventListener('keydown', enableFocusIndicator);