1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

add search landmark and disclosure pattern to menu

This commit is contained in:
krvpb024 2024-01-25 12:44:37 +08:00 committed by Frédéric Guillot
parent f23e6a3352
commit 6a9a590c7f
22 changed files with 119 additions and 64 deletions

View file

@ -28,17 +28,13 @@ function onAuxClick(selector, callback, noPreventDefault) {
// Show and hide the main menu on mobile devices.
function toggleMainMenu() {
let menu = document.querySelector(".header nav ul");
let menuToggleButton = document.querySelector(".header .logo a");
if (DomHelper.isVisible(menu)) {
menu.style.display = "none";
menuToggleButton.setAttribute("aria-expanded", false)
} else {
menu.style.display = "block";
}
let searchElement = document.querySelector(".header .search");
if (DomHelper.isVisible(searchElement)) {
searchElement.style.display = "none";
} else {
searchElement.style.display = "block";
menuToggleButton.setAttribute("aria-expanded", true)
}
}