This repository has been archived on 2024-05-29. You can view files and clone it, but cannot push or open issues or pull requests.
reset-sender-v2/public/client.js
2024-02-21 21:00:16 +01:00

16 lines
408 B
JavaScript

/**
* @param {Event} event
* @return {void}
*/
function handleDialogClick(event) {
const dialog = event.currentTarget;
const rect = dialog.getBoundingClientRect();
const clickedInDialog =
rect.top <= event.clientY &&
event.clientY <= rect.top + rect.height &&
rect.left <= event.clientX &&
event.clientX <= rect.left + rect.width;
if (!clickedInDialog) {
dialog.close();
}
}