mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-01-25 00:34:19 +03:00
Support any of /sS to focus docs search
This commit is contained in:
parent
c11d71c3cd
commit
cf867954c3
|
@ -218,6 +218,18 @@ function getQuery(name) {
|
|||
}
|
||||
}
|
||||
|
||||
document.onkeydown = function (e) {
|
||||
if (e.key == '/' || e.key == 's' || e.key == 'S') {
|
||||
if (document.activeElement != searchBox) {
|
||||
searchBox.focus();
|
||||
return false;
|
||||
}
|
||||
} else if (e.key == '?') {
|
||||
alert('Pressing any of: /sS\nWill focus the search bar\n\n' +
|
||||
'Pressing: enter\nWill navigate to the first match')
|
||||
}
|
||||
}
|
||||
|
||||
var query = getQuery('q');
|
||||
if (query) {
|
||||
searchBox.value = query;
|
||||
|
|
Loading…
Reference in New Issue
Block a user