mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-07-27 12:48:29 -06:00
Removed the Requirement to Install Python and NodeJS (Now Bundled with Borealis)
This commit is contained in:
21
Dependencies/Python/Doc/html/_static/search-focus.js
vendored
Normal file
21
Dependencies/Python/Doc/html/_static/search-focus.js
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
function isInputFocused() {
|
||||
const activeElement = document.activeElement;
|
||||
return (
|
||||
activeElement.tagName === 'INPUT' ||
|
||||
activeElement.tagName === 'TEXTAREA' ||
|
||||
activeElement.isContentEditable
|
||||
);
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.key === '/') {
|
||||
if (!isInputFocused()) {
|
||||
// Prevent "/" from being entered in the search box
|
||||
event.preventDefault();
|
||||
|
||||
// Set the focus on the search box
|
||||
const searchBox = document.getElementById('search-box');
|
||||
searchBox.focus();
|
||||
}
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user