searxngRebrandZaclys/searx/static/themes/simple/js/zaclys_searx.js

42 lines
946 B
JavaScript
Raw Normal View History

2023-08-28 07:52:05 +00:00
var isHidenUL = true;
function toggleMobileMenu(event) {
let hidenUL = document.querySelector('#mobile_menu');
//console.log('click event => toggleMobileMenu called')
2023-08-28 07:52:05 +00:00
if (hidenUL && isHidenUL) {
hidenUL.style.display = 'block';
isHidenUL = false;
} else if (hidenUL && !isHidenUL) {
hidenUL.style.display = 'none';
isHidenUL = true;
}
return false;
}
function hideMobileMenu(event) {
let hidenUL = document.querySelector('#mobile_menu');
//console.log('click event => toggleMobileMenu called')
if (hidenUL && !isHidenUL) {
hidenUL.style.display = 'none';
isHidenUL = true;
}
return false;
}
2023-08-28 07:52:05 +00:00
let elEvent = document.querySelector('#et_mobile_nav_menu');
//console.log(elEvent)
2023-08-28 07:52:05 +00:00
if (elEvent) {
document.querySelector('#mobile_menu').style.display = 'none';
elEvent.addEventListener("click", toggleMobileMenu);
document.querySelector("body").addEventListener("click", hideMobileMenu);
2023-08-28 07:52:05 +00:00
}