x
This commit is contained in:
parent
a402f5a08a
commit
98aa777fb4
1 changed files with 11 additions and 0 deletions
11
index.html
11
index.html
|
|
@ -581,6 +581,17 @@ function displayMovies(movies) {
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
fetchSpecificMovies();
|
fetchSpecificMovies();
|
||||||
fetchSpecificTvShows();
|
fetchSpecificTvShows();
|
||||||
|
|
||||||
|
// Add event listener for keydown on the entire document
|
||||||
|
document.addEventListener('keydown', function(e) {
|
||||||
|
// Check if the '/' key is pressed and if no input is currently focused
|
||||||
|
if (e.key === '/' && document.activeElement.tagName !== 'INPUT') {
|
||||||
|
// Prevent the default action to avoid typing the '/' character
|
||||||
|
e.preventDefault();
|
||||||
|
// Focus on the search input box
|
||||||
|
document.querySelector('[name="search"]').focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function fetchSpecificMovies() {
|
function fetchSpecificMovies() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue