Skip to content

Commit

Permalink
better func naming
Browse files Browse the repository at this point in the history
  • Loading branch information
drammock committed Jul 13, 2022
1 parent 097c12e commit 05d8706
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pydata_sphinx_theme/assets/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ var changeShortcutText = () => {
}
};

var findInput = () => {
var findSearchInput = () => {
/* if we knew we only had one search field, we could just do this:
*
* let input = document.querySelector("form.bd-search").querySelector("input");
Expand Down Expand Up @@ -210,7 +210,7 @@ var toggleSearchField = () => {
// If the page doesn't have an always-visible search field, then toggle the
// hidden one to hide or show, and (un)focus it. If there **IS** an
// always-visible search field on the page, (un)focus that instead.
let input = findInput();
let input = findSearchInput();
let button = document.getElementById("bd-search-button");
if (
input.parentElement.parentElement.classList.contains(
Expand All @@ -233,7 +233,7 @@ var toggleSearchField = () => {
window.addEventListener(
"keydown",
(event) => {
let input = findInput();
let input = findSearchInput();
// toggle on Ctrl+k or ⌘+k
if ((event.ctrlKey || event.metaKey) && event.code == "KeyK") {
event.preventDefault();
Expand Down

0 comments on commit 05d8706

Please sign in to comment.