Skip to content

Commit 12dab29

Browse files
committed
show/hide shortcut label using CSS
1 parent 61242d6 commit 12dab29

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

docs/_static/custom.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ div.admonition.admonition-todo>.admonition-title::before {
184184
display: block;
185185
}
186186

187+
#search-form:focus-within #shortcut-page,
188+
#search-form:focus-within #shortcut {
189+
display: none;
190+
}
191+
187192
#shortcut-page.input-group-text {
188193
padding-top: 0;
189194
padding-bottom: 0;

docs/_static/search_shortcut.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,13 @@
1212
$('#q').focus();
1313
}
1414
});
15-
16-
$('#q').focus(() => {
17-
$('#shortcut-page').hide();
18-
});
19-
$('#q').blur(() => {
20-
$('#shortcut-page').show();
21-
});
22-
23-
2415
} else {
2516
$(document).keydown(function(event) {
2617
if ((event.ctrlKey || event.metaKey) && event.key == "k") {
2718
event.preventDefault();
2819
$('#search-input').focus();
2920
}
3021
});
31-
32-
$('#search-input').focus(() => {
33-
$('#shortcut').hide();
34-
});
35-
$('#search-input').blur(() => {
36-
$('#shortcut').show();
37-
});
3822
}
3923

4024
// if OS isn't Mac change visual indication of search field

0 commit comments

Comments
 (0)