]> gitweb.factorcode.org Git - factor.git/blob - extra/webapps/help/search.js
db99569fc4e834bd9bccfa455f364855936f3ec2
[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 !== document.activeElement) {
12             event.preventDefault();
13             setTimeout(function() {
14                 input.focus().select()
15             }, 0);
16         }
17     }
18 });