UNPKG

@1771technologies/lytenyte-pro

Version:

Blazingly fast headless React data grid with 100s of features.

21 lines (20 loc) 703 B
export function dispatchActivate(el) { return el.dispatchEvent(new Event("ln-activate-mouse", { bubbles: false })); } export function dispatchDeactivate(el) { return el.dispatchEvent(new Event("ln-deactivate-mouse", { bubbles: false })); } export function dispatchClose(el) { return el.dispatchEvent(new Event("ln-close", { bubbles: false })); } export function getSubmenuRoots(el) { let current = el; const roots = []; while (current && current.getAttribute("data-ln-terminal-menu") !== "true") { if (current.getAttribute("data-ln-submenu-root") === "true") { roots.push(current); } current = current.parentElement; } return roots; }