公告板
版本库
filestore
活动
搜索
登录
谭勇
/
JNPF_ITMS_Web
培训系统前端代码
概况
操作记录
提交次数
目录
文档
派生
对比
blame
|
历史
|
原始文档
feat(tms): 完成课程考试自测等页面与接口对接
liuyu
昨天
93c133349a5ccd7a328371fa113dce69d5611f21
[~tanyong/JNPF_ITMS_Web.git]
/
packages
/
utils
/
src
/
helpers
/
get-popup-container.ts
1
2
3
4
5
6
7
8
/**
* If the node is holding inside a form, return the form element,
* otherwise return the parent node of the given element or
* the document body if the element is not provided.
*/
export function getPopupContainer(node?: HTMLElement): HTMLElement {
return node?.closest('form') ?? (node?.parentNode as HTMLElement) ?? document.body;
}