diff options
author | 2024-01-28 11:25:30 +0800 | |
---|---|---|
committer | 2024-02-04 10:47:30 -0800 | |
commit | 7413e383a8353620bd74219ca89fce6f8b43a9a1 (patch) | |
tree | 3d600c83597c728ad8abfc33d4e5fea4d4582248 /internal/ui/static/js/app.js | |
parent | 74964793804c207bbc482b1098d4fe04a352a91c (diff) | |
download | v2-7413e383a8353620bd74219ca89fce6f8b43a9a1.tar.gz v2-7413e383a8353620bd74219ca89fce6f8b43a9a1.tar.zst v2-7413e383a8353620bd74219ca89fce6f8b43a9a1.zip |
fix search and star function
Diffstat (limited to 'internal/ui/static/js/app.js')
-rw-r--r-- | internal/ui/static/js/app.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/internal/ui/static/js/app.js b/internal/ui/static/js/app.js index 39a77c8e..319c3cf2 100644 --- a/internal/ui/static/js/app.js +++ b/internal/ui/static/js/app.js @@ -27,7 +27,6 @@ function onAuxClick(selector, callback, noPreventDefault) { // Show and hide the main menu on mobile devices. function toggleMainMenu() { - console.log("clc") let menu = document.querySelector(".header nav ul"); let menuToggleButton = document.querySelector(".header button[aria-controls='header-menu']"); if (menu.classList.contains("js-menu-show")) { @@ -69,8 +68,16 @@ function handleSubmitButtons() { function setFocusToSearchInput(event) { event.preventDefault(); event.stopPropagation(); + const toggleSearchButton = document.querySelector(".search details") + console.log(toggleSearchButton.getAttribute("open")) + if (!toggleSearchButton.getAttribute("open")) { + toggleSearchButton.setAttribute("open", "") + const searchInputElement = document.getElementById("search-input"); + searchInputElement.focus(); + searchInputElement.value = ""; + } - let toggleSwitchElement = document.querySelector(".search-toggle-switch"); + /* let toggleSwitchElement = document.querySelector(".search-toggle-switch"); if (toggleSwitchElement) { toggleSwitchElement.style.display = "none"; } @@ -84,7 +91,7 @@ function setFocusToSearchInput(event) { if (searchInputElement) { searchInputElement.focus(); searchInputElement.value = ""; - } + } */ } // Show modal dialog with the list of keyboard shortcuts. |