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

17 lines
408 B
JavaScript
Raw Normal View History

2024-02-03 20:23:14 +01:00
/**
* @param {Event} event
* @return {void}
*/
function handleDialogClick(event) {
const dialog = event.currentTarget;
const rect = dialog.getBoundingClientRect();
2024-02-21 21:00:16 +01:00
const clickedInDialog =
rect.top <= event.clientY &&
2024-02-03 20:23:14 +01:00
event.clientY <= rect.top + rect.height &&
rect.left <= event.clientX &&
event.clientX <= rect.left + rect.width;
if (!clickedInDialog) {
dialog.close();
}
}