platform/plugins/board-resources/src/utils/PopupUtils.ts
Anna No 0843db0e04
Board: Add attachment action (#1474)
Signed-off-by: Anna No <anna.no@xored.com>
2022-04-21 17:59:07 +07:00

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
}