@@ -15,11 +15,13 @@ function initHotKeys() {
1515 document.body.classList.remove('has-active-search-window');
1616 }
1717
18− // / to close toggle window
18+ // / to open toggle window
1919 if (key === '/' || key === 'Period' || key === 58) {
20− event.preventDefault();
21− document.body.classList.toggle('has-active-search-window');
2220 if (bodyEl.classList.contains('has-active-search-window')) {
21+ // if it's already open don't do anything!
22+ } else {
23+ event.preventDefault();
24+ document.body.classList.add('has-active-search-window');
2325 searchInput.focus();
2426 }
2527 }
@@ -30,6 +32,14 @@ function initHotKeys() {
3032 searchInput.focus();
3133 }
3234 }
35+
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];
40+ firstresult.click();
41+ }
42+ }
3343 });
3444};
3545
@@ -242,17 +252,6 @@ function initSearch() {
242252 })
243253 }
244254
245− // Don't refresh the page on enter
246− searchInput.addEventListener('keydown', function(event){
247− var key = event.key || event.keyCode;
248−
249− if (key === 13 || key === "Enter") {
250− event.preventDefault();
251− return false;
252− }
253− })
254−
255−
256255 searchInput.addEventListener("keyup", debounce(function() {
257256 inputReset.style.display="block";
258257 glossaryResults.style.display="none";