From 27a3e0094a588d6f04c55f350b830d901d3dfffe Mon Sep 17 00:00:00 2001 From: MatthieuBarbu Date: Thu, 2 Nov 2023 15:55:57 +0100 Subject: [PATCH] fix mobile menu --- searx/static/themes/simple/js/zaclys_searx.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/searx/static/themes/simple/js/zaclys_searx.js b/searx/static/themes/simple/js/zaclys_searx.js index 2b1c46190..59a7f69cc 100644 --- a/searx/static/themes/simple/js/zaclys_searx.js +++ b/searx/static/themes/simple/js/zaclys_searx.js @@ -1,10 +1,12 @@ var isHidenUL = true; function toggleMobileMenu(event) { + event.stopPropagation(); let hidenUL = document.querySelector('#mobile_menu'); - //console.log('click event => toggleMobileMenu called') + /* console.log('click event => toggleMobileMenu called'); + console.log(hidenUL) */ if (hidenUL && isHidenUL) { hidenUL.style.display = 'block'; @@ -21,7 +23,9 @@ function hideMobileMenu(event) { let hidenUL = document.querySelector('#mobile_menu'); - //console.log('click event => toggleMobileMenu called') + /* console.log('click event => toggleMobileMenu called') + console.log(hidenUL) */ + if (hidenUL && !isHidenUL) { hidenUL.style.display = 'none'; @@ -33,7 +37,7 @@ function hideMobileMenu(event) { let elEvent = document.querySelector('#et_mobile_nav_menu'); -//console.log(elEvent) +console.log(elEvent) if (elEvent) { document.querySelector('#mobile_menu').style.display = 'none';