diff --git a/shablon/js/main.js b/shablon/js/main.js index 59ea0ae99..45a882b86 100644 --- a/shablon/js/main.js +++ b/shablon/js/main.js @@ -88,19 +88,19 @@ function sleep(time) { window.onclick = function (e) { - if (drop != undefined) { - if (document.querySelector('.profile_drop').classList.contains('active') && !e.target.closest('.profile_head')) { - document.querySelector('.profile_drop').classList.remove('active'); - } - } - - // drop.forEach(drop => { - // if (drop != undefined) { - // drop.classList.contains('active') && !e.target.closest('.profile_head'); - // drop.classList.remove('active') + // if (drop != undefined) { + // if (drop.classList.contains('active') && !e.target.closest('.profile_head')) { + // drop.classList.remove('active'); // } // } - // ); + + drop.forEach(drop => { + if (drop != undefined) { + drop.classList.contains('active') && !e.target.closest('.profile_head'); + drop.classList.remove('active') + } + } + ); if (register != undefined) { if (register.classList.contains('active') && !e.target.closest('.register_body')) { diff --git a/themes/birzha/assets/js/main.js b/themes/birzha/assets/js/main.js index 59ea0ae99..45a882b86 100644 --- a/themes/birzha/assets/js/main.js +++ b/themes/birzha/assets/js/main.js @@ -88,19 +88,19 @@ function sleep(time) { window.onclick = function (e) { - if (drop != undefined) { - if (document.querySelector('.profile_drop').classList.contains('active') && !e.target.closest('.profile_head')) { - document.querySelector('.profile_drop').classList.remove('active'); - } - } - - // drop.forEach(drop => { - // if (drop != undefined) { - // drop.classList.contains('active') && !e.target.closest('.profile_head'); - // drop.classList.remove('active') + // if (drop != undefined) { + // if (drop.classList.contains('active') && !e.target.closest('.profile_head')) { + // drop.classList.remove('active'); // } // } - // ); + + drop.forEach(drop => { + if (drop != undefined) { + drop.classList.contains('active') && !e.target.closest('.profile_head'); + drop.classList.remove('active') + } + } + ); if (register != undefined) { if (register.classList.contains('active') && !e.target.closest('.register_body')) {