[mod] improve handling of the hotkeys

- KeyboardEvent: keyCode property is depricated, replaced by key property [2]

- the check for ifDetailOpened is not necessary, because the hotkeys are not
  only applicable to image-results, by example:

   `!goi !go !scc hello`

- Key bindings like h for help are to be used in general (not only in vim-mode)

[1] https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
[2] https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2023-09-11 20:18:56 +02:00 committed by Markus Heiser
parent e6b160da62
commit a987672340
2 changed files with 92 additions and 102 deletions

View file

@ -74,10 +74,6 @@
searxng.scrollPageToSelected();
}
searxng.isDetailOpened = function () {
return d.getElementById('results').classList.contains('image-detail-open');
}
searxng.closeDetail = function (e) {
d.getElementById('results').classList.remove('image-detail-open');
searxng.scrollPageToSelected();