MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / findBlockId

Function findBlockId

frontend/util/focusutil.ts:6–15  ·  view source on GitHub ↗
(element: HTMLElement)

Source from the content-addressed store, hash-verified

4import * as util from "./util";
5
6export function findBlockId(element: HTMLElement): string | null {
7 let current: HTMLElement = element;
8 while (current) {
9 if (current.hasAttribute("data-blockid")) {
10 return current.getAttribute("data-blockid");
11 }
12 current = current.parentElement;
13 }
14 return null;
15}
16
17export function getElemAsStr(elem: EventTarget) {
18 if (elem == null) {

Callers 2

getElemAsStrFunction · 0.85
focusedBlockIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected