mirror of https://gitee.com/openkylin/qemu.git
docs/sphinx: add 's' keyboard binding to focus search
This is pretty ubiquitous. ('/' is already taken by some browsers for quick search) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
96871b3854
commit
9423751645
|
@ -182,6 +182,10 @@
|
||||||
'theme_overrides.css',
|
'theme_overrides.css',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
html_js_files = [
|
||||||
|
'custom.js',
|
||||||
|
]
|
||||||
|
|
||||||
html_context = {
|
html_context = {
|
||||||
"display_gitlab": True,
|
"display_gitlab": True,
|
||||||
"gitlab_user": "qemu-project",
|
"gitlab_user": "qemu-project",
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
document.addEventListener('keydown', (event) => {
|
||||||
|
// find a better way to look it up?
|
||||||
|
let search_input = document.getElementsByName('q')[0];
|
||||||
|
|
||||||
|
if (event.code === 'KeyS' && document.activeElement !== search_input) {
|
||||||
|
event.preventDefault();
|
||||||
|
search_input.focus();
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in New Issue