add a trigger for addon search

This commit is contained in:
Alex Xu
2024-10-16 14:48:11 -04:00
parent 956d62e621
commit 9d28329735
2 changed files with 11 additions and 0 deletions

View File

@@ -117,3 +117,8 @@ html_theme_options = {"link_main_doc": False}
redirects = {"reference/openmp/openmp": "../../about/compatibility/openmp.html"}
numfig = False
html_js_files = [
"readthedocs.js",
]

6
docs/readthedocs.js Normal file
View File

@@ -0,0 +1,6 @@
// Trigger the Read the Docs Addons Search modal when clicking on "Search docs" input from the topnav.
document.querySelector("[role='search'] input").addEventListener("focusin", () => {
const event = new CustomEvent("readthedocs-search-show");
document.dispatchEvent(event);
});