(element: HTMLElement)
| 4 | import * as util from "./util"; |
| 5 | |
| 6 | export 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 | |
| 17 | export function getElemAsStr(elem: EventTarget) { |
| 18 | if (elem == null) { |
no outgoing calls
no test coverage detected