lastParent(arg1, count = 1) {
    /** Recursive algorithm for finding parent elements */
    const findParent = (item, type) => {      
      if ( !item.parent() ) {
        return null;
      } else if ( typeof item.parent() == 'object' && item.parent().constructor && item.parent().constructor.name.toLowerCase() == arg1.toLowerCase() ) {
        count--;
      
        if ( count == 0 )
          return item.parent();
      }
    
      return findParent(item.parent(), type);
    };
    
    /** Find parent element */
    return findParent(this.last(arg1));
  }
/**
   * Find last parent item of certain object type in contents.
   * @signature lastParent(string) Get the last parent item of type (string) in contents
   * @return The last parent item of type (string) in contents
   */
Find last parent item of certain object type in contents.
@signature lastParent(string) Get the last parent item of type (string) in contents
@return The last parent item of type (string) in contents
Find last parent item of certain object type in contents . @signature lastParent ( string ) Get the last parent item of type ( string ) in contents @return The last parent item of type ( string ) in contents
lastParent(arg1, count = 1) {
    const findParent = (item, type) => {      
      if ( !item.parent() ) {
        return null;
      } else if ( typeof item.parent() == 'object' && item.parent().constructor && item.parent().constructor.name.toLowerCase() == arg1.toLowerCase() ) {
        count--;
        if ( count == 0 )
          return item.parent();
      }
      return findParent(item.parent(), type);
    };
    return findParent(this.last(arg1));
  }
lastParent ( arg1 , count = 1 ) { const findParent = ( item , type ) => { if ( ! item . parent ( ) ) { return null ; } else if ( typeof item . parent ( ) == 'object' && item . parent ( ) . constructor && item . parent ( ) . constructor . name . toLowerCase ( ) == arg1 . toLowerCase ( ) ) { count -- ; if ( count == 0 ) return item . parent ( ) ; } return findParent ( item . parent ( ) , type ) ; } ; return findParent ( this . last ( arg1 ) ) ; }
Find last parent item of certain object type in contents.
Find last parent item of certain object type in contents .
/** Recursive algorithm for finding parent elements */ /** Find parent element */