treeloom
    Preparing search index...

    Function getParentsByClass

    • Helper for getting all domGeneral.DomItems going up from item's parent, each one carrying the given class, among possibly several space-separated classes on that item - the same membership check as the real DOM's classList.contains, not an exact match of the whole className attribute string (which getParentsFromAttribute does, and which would miss a parent that also carries other classes). WARNING: This is a recursive function.

      Parameters

      • className: string

        The one class being searched for

      • item: DomItem = ...

        The DomItem which may have parent items carrying the class

      Returns DomItem[]