static findParent()

in src/utilities/graph-util.js [117:133]


  static findParent(element: any, selector: string, stopAtSelector?: string) {
    if (!element || (stopAtSelector && element?.matches?.(stopAtSelector))) {
      return null;
    }

    if (element?.matches?.(selector)) {
      return element;
    } else if (element?.parentNode) {
      return GraphUtils.findParent(
        element.parentNode,
        selector,
        stopAtSelector
      );
    }

    return null;
  }