]> gitweb.factorcode.org Git - factor.git/blob - extra/webapps/help/search.js
help.html: add null check
[factor.git] / extra / webapps / help / search.js
1 window.onload = function() {
2     var radios = document.getElementsByClassName("radiotab");
3     if (radios.length > 0) {
4         radios[0].checked = true;
5     }
6 }
7
8 document.addEventListener('keydown', function (event) {
9     if (event.code == 'Slash') {
10         let input = document.getElementById('search');
11         if (input != null) {
12             if (input !== document.activeElement) {
13                 event.preventDefault();
14                 setTimeout(function() {
15                     input.focus().select()
16                 }, 0);
17             }
18         }
19     }
20 });