mirror of
https://github.com/KevinMidboe/infra-map.git
synced 2026-03-11 00:20:32 +00:00
working nice. docker uses bun
This commit is contained in:
14
src/lib/utils/mouseEvents.ts
Normal file
14
src/lib/utils/mouseEvents.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export function clickOutside(event: MouseEvent, element: Element | undefined) {
|
||||
if (!element) return false;
|
||||
|
||||
const rect = element.getBoundingClientRect();
|
||||
if (!rect) return false;
|
||||
|
||||
const isClickOutside =
|
||||
event.clientX < rect.left ||
|
||||
event.clientX > rect.right ||
|
||||
event.clientY < rect.top ||
|
||||
event.clientY > rect.bottom;
|
||||
|
||||
return isClickOutside ? true : false;
|
||||
}
|
||||
Reference in New Issue
Block a user