8709fd15cc1c75ecff1fb2ec9f2a4778766e1c83
[vchess.git] / client / src / utils / modalClick.js
1 export function processModalClick(e, cb) {
2 // Close a modal when click on it but outside focused element
3 const data = e.target.dataset;
4 if (!!data.checkbox) document.getElementById(data.checkbox).checked = false;
5 if (!!cb && ["chatWrap","peopleWrap"].includes(e.target.id)) cb();
6 }