@@ -15,11 +15,13 @@ function initHotKeys() {
15 document.body.classList.remove('has-active-search-window');
15 document.body.classList.remove('has-active-search-window');
18− // / to close toggle window
18+ // / to open toggle window
19 if (key === '/' || key === 'Period' || key === 58) {
19 if (key === '/' || key === 'Period' || key === 58) {
20− event.preventDefault();
21− document.body.classList.toggle('has-active-search-window');
22 if (bodyEl.classList.contains('has-active-search-window')) {
20 if (bodyEl.classList.contains('has-active-search-window')) {
21+ // if it's already open don't do anything!
23+ event.preventDefault();
24+ document.body.classList.add('has-active-search-window');
23 searchInput.focus();
25 searchInput.focus();
@@ -30,6 +32,14 @@ function initHotKeys() {
30 searchInput.focus();
32 searchInput.focus();
36+ if (bodyEl.classList.contains('has-active-search-window')) {
37+ if (key === 'Enter' || key === 'Return' || key === 13) {
38+ event.preventDefault();
39+ let firstresult = document.querySelectorAll("div#full-results a")[0];
@@ -242,17 +252,6 @@ function initSearch() {
245− // Don't refresh the page on enter
246− searchInput.addEventListener('keydown', function(event){
247− var key = event.key || event.keyCode;
249− if (key === 13 || key === "Enter") {
250− event.preventDefault();
256 searchInput.addEventListener("keyup", debounce(function() {
255 searchInput.addEventListener("keyup", debounce(function() {
257 inputReset.style.display="block";
256 inputReset.style.display="block";
258 glossaryResults.style.display="none";
257 glossaryResults.style.display="none";