mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
632 B
JavaScript
18 lines
632 B
JavaScript
document.addEventListener('DOMContentLoaded',function () {
|
|
document.querySelector('#rect-toggle')?.addEventListener('click',function (e) {
|
|
e.preventDefault();
|
|
document.querySelector('#RecetMenu').classList.toggle('show-menu');
|
|
setTimeout(function () {
|
|
document.addEventListener('click', handleDocumentClick);
|
|
},100);
|
|
});
|
|
})
|
|
|
|
|
|
function handleDocumentClick(e) {
|
|
if (!document.querySelector('#RecetMenu').contains(e.target)) {
|
|
document.querySelector('#RecetMenu').classList.toggle('show-menu');
|
|
document.removeEventListener('click', handleDocumentClick);
|
|
}
|
|
}
|