MCPcopy Create free account
hub / github.com/msgbyte/tailchat / getDOMParentPath

Function getDOMParentPath

client/web/src/utils/dom-helper.ts:31–40  ·  view source on GitHub ↗
(el: HTMLElement)

Source from the content-addressed store, hash-verified

29 * 获取元素所有的DOM父节点列表
30 */
31export function getDOMParentPath(el: HTMLElement): HTMLElement[] {
32 const path: HTMLElement[] = [];
33 let parent = el.parentElement;
34 while (parent) {
35 path.unshift(parent);
36 parent = parent.parentElement;
37 }
38
39 return path;
40}
41
42/**
43 * 创建一个RAF循环

Callers 1

withKeepAliveOverlayFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected