mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-26 10:20:01 +00:00
17 lines
388 B
TypeScript
17 lines
388 B
TypeScript
import { PopupAlignment } from '@anticrm/ui'
|
|
|
|
export function getPopupAlignment (e?: Event): PopupAlignment | undefined {
|
|
if (!e || !e.target) {
|
|
return undefined
|
|
}
|
|
const target = e.target as HTMLElement
|
|
if (target.getBoundingClientRect) {
|
|
const result = target.getBoundingClientRect()
|
|
return {
|
|
getBoundingClientRect: () => result
|
|
}
|
|
}
|
|
|
|
return undefined
|
|
}
|