added listener to close user control
This commit is contained in:
parent
f3381ba8da
commit
bbc4a9356c
@ -81,6 +81,12 @@ document.addEventListener('DOMContentLoaded', function (event) {
|
|||||||
}
|
}
|
||||||
}).catch(error => console.log(error));
|
}).catch(error => console.log(error));
|
||||||
|
|
||||||
|
// Document -> close menu
|
||||||
|
document.addEventListener("click", event => {
|
||||||
|
if (!event.target.closest('#user-controls')) {
|
||||||
|
let userControls = this.querySelector('#user-controls');
|
||||||
|
if (userControls) userControls.removeAttribute("open");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user